tests/Parser/ParserTest.php
/**
     * Test parse with empty test.
     */
Test parse with empty test.
Test parse with empty test .
public function testParseWithEmptyTest()
    {
        $parser = new Parser();
        $parseContext = new ParseContext();
        $parseResult = $parser->parse(
            FilePath::parse('foo.webunit'),
            [
                'get http://example.com/',
            ],
            $parseContext,
        );
        $testSuite = $parseResult->getTestSuite();
        $testCases = $testSuite->getTestCases();
        self::assertSame(1, count($testCases));
        self::assertSame('http://example.com/', $testCases[0]->getUrl()->__toString());
        self::assertSame(1, count($testCases[0]->getAsserts()));
        self::assertInstanceOf(DefaultAssert::class, $testCases[0]->getAsserts()[0]);
        self::assertSame([], $parseResult->getParseErrors());
        self::assertTrue($parseResult->isSuccess());
    }
public function testParseWithEmptyTest ( ) { $ parser = new Parser ( ) ; $ parseContext = new ParseContext ( ) ; $ parseResult = $ parser -> parse ( FilePath :: parse ( 'foo.webunit' ) , [ 'get http://example.com/' , ] , $ parseContext , ) ; $ testSuite = $ parseResult -> getTestSuite ( ) ; $ testCases = $ testSuite -> getTestCases ( ) ; self :: assertSame ( 1 , count ( $ testCases ) ) ; self :: assertSame ( 'http://example.com/' , $ testCases [ 0 ] -> getUrl ( ) -> __toString ( ) ) ; self :: assertSame ( 1 , count ( $ testCases [ 0 ] -> getAsserts ( ) ) ) ; self :: assertInstanceOf ( DefaultAssert :: class , $ testCases [ 0 ] -> getAsserts ( ) [ 0 ] ) ; self :: assertSame ( [ ] , $ parseResult -> getParseErrors ( ) ) ; self :: assertTrue ( $ parseResult -> isSuccess ( ) ) ; }
Test parse with empty test.
Test parse with empty test .