1 | <?php |
||
19 | class ClassLoaderTraitTest extends \PHPUnit_Framework_TestCase{ |
||
20 | |||
21 | /** |
||
22 | * @var \chillerlan\bbcode\Parser |
||
23 | */ |
||
24 | protected $parser; |
||
25 | |||
26 | /** |
||
27 | * @var \ReflectionClass |
||
28 | */ |
||
29 | protected $reflectionClass; |
||
30 | |||
31 | protected function setUp(){ |
||
32 | $this->reflectionClass = new ReflectionClass(Parser::class); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @expectedException \chillerlan\BBCode\BBCodeException |
||
37 | * @expectedExceptionMessage stdClass does not implement chillerlan\bbcode\Modules\BaseModuleInterface |
||
38 | */ |
||
39 | public function testClassLoaderDoesNotImplementException(){ |
||
40 | $options = new ParserOptions; |
||
41 | $options->baseModuleInterface = stdClass::class; |
||
42 | |||
43 | $this->parser = $this->reflectionClass->newInstanceArgs([$options]); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @expectedException \chillerlan\BBCode\BBCodeException |
||
48 | * @expectedExceptionMessage foobar does not exist |
||
49 | */ |
||
50 | public function testClassLoaderDoesNotExistException(){ |
||
51 | $options = new ParserOptions; |
||
52 | $options->baseModuleInterface = 'foobar'; |
||
53 | |||
54 | $this->parser = $this->reflectionClass->newInstanceArgs([$options]); |
||
55 | } |
||
56 | |||
57 | } |
||
58 |