title: PHPUnit assertTrue if regex text found?
body: <p>I'm using PHPUnit and trying to check if text exists on a page. The assertRegExp works but using the if statement I get the error <code>Failed asserting that null is true.</code></p>
  
  <p>I understand that $test is returning null, but I don't know how to have it return 1 or 0 or true/false if the text exists? Any help's appreciated thanks.</p>
  
  <pre><code>        $element = $this-&gt;byCssSelector('body')-&gt;text();
          $test = $this-&gt;assertRegExp('/find this text/i',$element);
  
          if($this-&gt;assertTrue($test)){
              echo 'text found';
          }
          else{
              echo 'not found';
          }
  </code></pre>