diff options
Diffstat (limited to 'tests/lib/AppFramework/Utility/SimpleContainerTest.php')
-rw-r--r-- | tests/lib/AppFramework/Utility/SimpleContainerTest.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php index cfd55d8d6d8..0341be14af9 100644 --- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php +++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php @@ -61,7 +61,7 @@ class SimpleContainerTest extends \Test\TestCase { private $container; - public function setUp(): void { + protected function setUp(): void { $this->container = new SimpleContainer(); } @@ -72,18 +72,18 @@ class SimpleContainerTest extends \Test\TestCase { } - /** - * @expectedException \OCP\AppFramework\QueryException - */ + public function testNothingRegistered() { + $this->expectException(\OCP\AppFramework\QueryException::class); + $this->container->query('something really hard'); } - /** - * @expectedException \OCP\AppFramework\QueryException - */ + public function testNotAClass() { + $this->expectException(\OCP\AppFramework\QueryException::class); + $this->container->query('Test\AppFramework\Utility\TestInterface'); } @@ -189,10 +189,10 @@ class SimpleContainerTest extends \Test\TestCase { $this->assertEquals('abc', $this->container->query($query)); } - /** - * @expectedException \OCP\AppFramework\QueryException - */ + public function testConstructorComplexNoTestParameterFound() { + $this->expectException(\OCP\AppFramework\QueryException::class); + $object = $this->container->query( 'Test\AppFramework\Utility\ClassComplexConstructor' ); |