public function checkFileContent($file, $partialContent, $expectMatch)
    {
        $regexp = "/" . preg_quote($partialContent, "/") . "/";
        $this->inCurrentDir(function() use ($file, $regexp, $expectMatch) {
            $contents = file_get_contents($file);

            $match = preg_match($regexp, $contents);

            if ($expectMatch && !$match) {
                throw new ExpectationException("Could not match $match to $contents");
            }

            if ($match && !$expectMatch) {
                throw new ExpectationException("Matched $match to $contents");
            }
        });
    }
public function checkFileContent($file, $partialContent, $expectMatch)
    {
        $regexp = "/" . preg_quote($partialContent, "/") . "/";
        $this->inCurrentDir(function() use ($file, $regexp, $expectMatch) {
            $contents = file_get_contents($file);

            $match = preg_match($regexp, $contents);

            if ($expectMatch && !$match) {
                throw new ExpectationException("Could not match $match to $contents");
            }

            if ($match && !$expectMatch) {
                throw new ExpectationException("Matched $match to $contents");
            }
        });
    }
public function checkFileContent ( $ file , $ partialContent , $ expectMatch ) { $ regexp = "/" . preg_quote ( $ partialContent , "/" ) . "/" ; $ this -> inCurrentDir ( function ( ) use ( $ file , $ regexp , $ expectMatch ) { $ contents = file_get_contents ( $ file ) ; $ match = preg_match ( $ regexp , $ contents ) ; if ( $ expectMatch && ! $ match ) { throw new ExpectationException ( "Could not match $match to $contents" ) ; } if ( $ match && ! $ expectMatch ) { throw new ExpectationException ( "Matched $match to $contents" ) ; } } ) ; }
Check a files contents

@param string $file
@param string $partialContent
@param bool $expectMatch
Check a files contents