/** * tests running the generation of a grep command * * @group generator * @group sourcetest */ public function testRun() { $mockLogger = $this->getMock('\\Monolog\\Logger', array(), array(), '', false); self::assertSame($this->object, $this->object->setLogger($mockLogger)); $mockBrowscap = $this->getMock('\\phpbrowscap\\Browscap', array(), array(), '', false); $tmpfile = tempnam(sys_get_temp_dir(), 'browscaptest'); $in = <<<HERE ; comment test HERE; file_put_contents($tmpfile, $in); self::assertNull($this->object->run($mockBrowscap, $tmpfile, GrepCommand::MODE_UNMATCHED)); unlink($tmpfile); }
/** * tests running the generation of a grep command * * @group generator * @group sourcetest */ public function testRun() { $logger = $this->createMock(\Monolog\Logger::class); self::assertSame($this->object, $this->object->setLogger($logger)); $mockBrowscap = $this->createMock(\BrowscapPHP\Browscap::class); $tmpfile = tempnam(sys_get_temp_dir(), 'browscaptest'); $in = <<<HERE ; comment test HERE; file_put_contents($tmpfile, $in); self::assertNull($this->object->run($mockBrowscap, $tmpfile, GrepCommand::MODE_UNMATCHED)); unlink($tmpfile); }