tests/Application/ConsoleApplicationTest.php
/**
     * Test running application with failed test suite with set command line parameters.
     */
Test running application with failed test suite with set command line parameters.
Test running application with failed test suite with set command line parameters .
public function testFailedTestSuiteWithSet()
    {
        $testfilePath = FilePath::parse(__DIR__ . '/../Helpers/WebunitTests/set-required.webunit');
        $consoleApplication = new ConsoleApplication(['webunit', '--set=DOMAIN=example.com', $testfilePath->__toString(), '--set=EXPECTED_CONTENT=Foo'], $this->httpClient);
        ob_start();
        $result = $consoleApplication->run();
        $output = ob_get_contents();
        ob_end_clean();
        self::assertSame(5, $result);
        self::assertSame(
            'Webunit v' . ConsoleApplication::WEBUNIT_VERSION . PHP_EOL .
            ".\033[41m\033[1;37mF\033[0m" . PHP_EOL .
            "$testfilePath:4: Test failed: https://example.com/: Content \"Hello World!\" does not equal \"Foo\"." . PHP_EOL .
            "\033[41m\033[1;37m1 test failed.\033[0m" . PHP_EOL,
            $output
        );
    }
public function testFailedTestSuiteWithSet ( ) { $ testfilePath = FilePath :: parse ( __DIR__ . '/../Helpers/WebunitTests/set-required.webunit' ) ; $ consoleApplication = new ConsoleApplication ( [ 'webunit' , '--set=DOMAIN=example.com' , $ testfilePath -> __toString ( ) , '--set=EXPECTED_CONTENT=Foo' ] , $ this -> httpClient ) ; ob_start ( ) ; $ result = $ consoleApplication -> run ( ) ; $ output = ob_get_contents ( ) ; ob_end_clean ( ) ; self :: assertSame ( 5 , $ result ) ; self :: assertSame ( 'Webunit v' . ConsoleApplication :: WEBUNIT_VERSION . PHP_EOL . " . \033 [41m \033 [1;37mF \033 [0m " . PHP_EOL . " $ testfilePath :4: Test failed: https://example.com/: Content  \" Hello World! \"  does not equal  \" Foo \" . " . PHP_EOL . " \033 [41m \033 [1;37m1 test failed. \033 [0m " . PHP_EOL , $ output ) ; }
Test running application with failed test suite with set command line parameters.
Test running application with failed test suite with set command line parameters .