tests/TestCaseTest.php
/**
     * Test case with status code assert (should remove default assert).
     */
Test case with status code assert (should remove default assert).
Test case with status code assert ( should remove default assert ) .
public function testStatusCodeAssertRemovesDefaultAssert()
    {
        $location = new FileLocation(FilePath::parse('./foo.webunit'), 1);
        $assert1 = new AssertContains($location, 'Foo', new Modifiers());
        $assert2 = new AssertStatusCode($location, 404, new Modifiers());
        $assert3 = new AssertEmpty($location, new Modifiers());
        $testCase = new \MichaelHall\Webunit\TestCase($location, Url::parse('http://localhost'));
        $testCase->addAssert($assert1);
        $testCase->addAssert($assert2);
        $testCase->addAssert($assert3);
        self::assertSame(3, count($testCase->getAsserts()));
        self::assertSame($assert1, $testCase->getAsserts()[0]);
        self::assertSame($assert2, $testCase->getAsserts()[1]);
        self::assertSame($assert3, $testCase->getAsserts()[2]);
    }
public function testStatusCodeAssertRemovesDefaultAssert ( ) { $ location = new FileLocation ( FilePath :: parse ( './foo.webunit' ) , 1 ) ; $ assert1 = new AssertContains ( $ location , 'Foo' , new Modifiers ( ) ) ; $ assert2 = new AssertStatusCode ( $ location , 404 , new Modifiers ( ) ) ; $ assert3 = new AssertEmpty ( $ location , new Modifiers ( ) ) ; $ testCase = new \ MichaelHall \ Webunit \ TestCase ( $ location , Url :: parse ( 'http://localhost' ) ) ; $ testCase -> addAssert ( $ assert1 ) ; $ testCase -> addAssert ( $ assert2 ) ; $ testCase -> addAssert ( $ assert3 ) ; self :: assertSame ( 3 , count ( $ testCase -> getAsserts ( ) ) ) ; self :: assertSame ( $ assert1 , $ testCase -> getAsserts ( ) [ 0 ] ) ; self :: assertSame ( $ assert2 , $ testCase -> getAsserts ( ) [ 1 ] ) ; self :: assertSame ( $ assert3 , $ testCase -> getAsserts ( ) [ 2 ] ) ; }
Test case with status code assert (should remove default assert).
Test case with status code assert ( should remove default assert ) .