tests/Application/ConsoleApplicationTest.php
/**
     * Test various command line parameter errors.
     *
     * @dataProvider commandLineParameterErrorsDataProvider
     *
     * @param array  $commandLineParameters The command line parameters.
     * @param string $expectedErrorMessage  The expected error message.
     */
Test various command line parameter errors.

@param array  $commandLineParameters The command line parameters.
@param string $expectedErrorMessage  The expected error message.
Test various command line parameter errors . @param array $commandLineParameters The command line parameters . @param string $expectedErrorMessage The expected error message .
public function testCommandLineParameterErrors(array $commandLineParameters, string $expectedErrorMessage)
    {
        $consoleApplication = new ConsoleApplication($commandLineParameters, $this->httpClient);
        ob_start();
        $result = $consoleApplication->run();
        $output = ob_get_contents();
        ob_end_clean();
        self::assertSame(2, $result);
        self::assertSame(
            'Webunit v' . ConsoleApplication::WEBUNIT_VERSION . PHP_EOL .
            "\033[41m\033[1;37m" . $expectedErrorMessage . "\033[0m" . PHP_EOL .
            'Usage: webunit [options] testfile' . PHP_EOL,
            $output
        );
    }
public function testCommandLineParameterErrors ( array $ commandLineParameters , string $ expectedErrorMessage ) { $ consoleApplication = new ConsoleApplication ( $ commandLineParameters , $ this -> httpClient ) ; ob_start ( ) ; $ result = $ consoleApplication -> run ( ) ; $ output = ob_get_contents ( ) ; ob_end_clean ( ) ; self :: assertSame ( 2 , $ result ) ; self :: assertSame ( 'Webunit v' . ConsoleApplication :: WEBUNIT_VERSION . PHP_EOL . " \033 [41m \033 [1;37m " . $ expectedErrorMessage . " \033 [0m " . PHP_EOL . 'Usage: webunit [options] testfile' . PHP_EOL , $ output ) ; }
Test various command line parameter errors.
Test various command line parameter errors .