1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

cleanup and tests

This commit is contained in:
Robin Appelman 2017-04-09 17:24:15 +02:00
commit 05f48fd0a0
7 changed files with 110 additions and 25 deletions

View file

@ -7,7 +7,7 @@ use Demostf\API\Demo\RawParser;
use Demostf\API\Test\TestCase;
class ParserTest extends TestCase {
/** @var RawParser */
/** @var RawParser|\PHPUnit_Framework_MockObject_MockObject */
private $rawParser;
public function setUp() {
@ -34,4 +34,22 @@ class ParserTest extends TestCase {
$this->assertEquals($expected, $result);
}
/**
* @expectedException \InvalidArgumentException
*/
public function testFailedParse() {
/** @var RawParser|\PHPUnit_Framework_MockObject_MockObject $rawParser */
$rawParser = $this->getMockBuilder(RawParser::class)
->disableOriginalConstructor()
->getMock();
$parser = new Parser($rawParser);
$rawParser->expects($this->any())
->method('parse')
->willReturn(null);
$parser->analyse('foo');
}
}