tests/Assertions/AssertHeaderTest.php
/**
     * Test assertion.
     *
     * @dataProvider assertionDataProvider
     *
     * @param string      $assertContent       The assert content.
     * @param int         $modifiers           The modifiers.
     * @param string[]    $headers             The headers.
     * @param bool        $expectedSuccess     True the expected result is success, false otherwise.
     * @param string      $expectedError       The expected error.
     * @param string      $expectedHeaderName  The expected header name.
     * @param string|null $expectedHeaderValue The expected header value or null if no header value is expected.
     */
Test assertion.

@param string      $assertContent       The assert content.
@param int         $modifiers           The modifiers.
@param string[]    $headers             The headers.
@param bool        $expectedSuccess     True the expected result is success, false otherwise.
@param string      $expectedError       The expected error.
@param string      $expectedHeaderName  The expected header name.
@param string|null $expectedHeaderValue The expected header value or null if no header value is expected.
Test assertion . @param string $assertContent The assert content . @param int $modifiers The modifiers . @param string [] $headers The headers . @param bool $expectedSuccess True the expected result is success false otherwise . @param string $expectedError The expected error . @param string $expectedHeaderName The expected header name . @param string|null $expectedHeaderValue The expected header value or null if no header value is expected .
public function testAssertion(string $assertContent, int $modifiers, array $headers, bool $expectedSuccess, string $expectedError, string $expectedHeaderName, ?string $expectedHeaderValue)
    {
        $location = new FileLocation(FilePath::parse('/tmp/tests'), 10);
        $assert = new AssertHeader($location, $assertContent, new Modifiers($modifiers));
        $pageResult = new PageResult(200, $headers, '');
        $result = $assert->test($pageResult);
        self::assertSame($location, $assert->getLocation());
        self::assertSame($expectedHeaderName, $assert->getHeaderName());
        self::assertSame($expectedHeaderValue, $assert->getHeaderValue());
        self::assertSame($expectedSuccess, $result->isSuccess());
        self::assertSame($expectedError, $result->getError());
    }
public function testAssertion ( string $ assertContent , int $ modifiers , array $ headers , bool $ expectedSuccess , string $ expectedError , string $ expectedHeaderName , ? string $ expectedHeaderValue ) { $ location = new FileLocation ( FilePath :: parse ( '/tmp/tests' ) , 10 ) ; $ assert = new AssertHeader ( $ location , $ assertContent , new Modifiers ( $ modifiers ) ) ; $ pageResult = new PageResult ( 200 , $ headers , '' ) ; $ result = $ assert -> test ( $ pageResult ) ; self :: assertSame ( $ location , $ assert -> getLocation ( ) ) ; self :: assertSame ( $ expectedHeaderName , $ assert -> getHeaderName ( ) ) ; self :: assertSame ( $ expectedHeaderValue , $ assert -> getHeaderValue ( ) ) ; self :: assertSame ( $ expectedSuccess , $ result -> isSuccess ( ) ) ; self :: assertSame ( $ expectedError , $ result -> getError ( ) ) ; }
Test assertion.
Test assertion .