run() public method

Entry point for generating builds for a specified version
public run ( Browscap $browscap, string $inputFile, string $mode )
$browscap BrowscapPHP\Browscap
$inputFile string
$mode string
Example #1
0
    /**
     * 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);
    }
Example #2
0
    /**
     * 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);
    }