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

bump phpunit

This commit is contained in:
Robin Appelman 2019-04-12 13:36:56 +02:00
commit a17fad62e7
14 changed files with 291 additions and 342 deletions

View file

@ -7,6 +7,7 @@ namespace Demostf\API\Test\Demo;
use Demostf\API\Demo\Header;
use Demostf\API\Demo\HeaderParser;
use Demostf\API\Test\TestCase;
use InvalidArgumentException;
class HeaderParserTest extends TestCase {
public function testParseFile() {
@ -40,28 +41,25 @@ class HeaderParserTest extends TestCase {
$this->assertEquals($expected->getVersion(), $parsed->getVersion());
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Not an HL2 demo
*/
public function testNonDemoShort() {
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Not an HL2 demo");
$parser = new HeaderParser();
$parser->parseString('short');
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Not an HL2 demo
*/
public function testNonDemoLong() {
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("Not an HL2 demo");
$parser = new HeaderParser();
$parser->parseHeader(__FILE__);
}
/**
* @expectedException \InvalidArgumentException
*/
public function testNonExisting() {
$this->expectException(InvalidArgumentException::class);
$parser = new HeaderParser();
$parser->parseHeader('/non/existing');
}