GitWrapper\Test\GitWorkingCopyTest::testLiveOutput PHP Méthode

testLiveOutput() public méthode

public testLiveOutput ( )
    public function testLiveOutput()
    {
        $git = $this->getWorkingCopy();
        // Capture output written to STDOUT and use echo so we can suppress and
        // capture it using normal output buffering.
        stream_filter_register('suppress', '\\GitWrapper\\Test\\StreamSuppressFilter');
        $stdoutSuppress = stream_filter_append(STDOUT, 'suppress');
        $git->getWrapper()->streamOutput(true);
        ob_start();
        $git->status();
        $contents = ob_get_contents();
        ob_end_clean();
        $this->assertTrue(stripos($contents, 'nothing to commit') !== false);
        $git->clearOutput();
        $git->getWrapper()->streamOutput(false);
        ob_start();
        $git->status();
        $empty = ob_get_contents();
        ob_end_clean();
        $this->assertEmpty($empty);
        stream_filter_remove($stdoutSuppress);
    }