summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Utility/SimpleContainerTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/AppFramework/Utility/SimpleContainerTest.php
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz
nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/AppFramework/Utility/SimpleContainerTest.php')
-rw-r--r--tests/lib/AppFramework/Utility/SimpleContainerTest.php20
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'
);