From 3a7cf40aaa678bea1df143d2982d603b7a334eec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 27 Nov 2019 15:27:18 +0100 Subject: Mode to modern phpunit Signed-off-by: Roeland Jago Douma --- tests/lib/AppFramework/Db/EntityTest.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/lib/AppFramework/Db/EntityTest.php') diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php index 3eb9f6eef51..c8ebda55a86 100644 --- a/tests/lib/AppFramework/Db/EntityTest.php +++ b/tests/lib/AppFramework/Db/EntityTest.php @@ -129,25 +129,25 @@ class EntityTest extends \Test\TestCase { } - /** - * @expectedException \BadFunctionCallException - */ + public function testCallShouldOnlyWorkForGetterSetter(){ + $this->expectException(\BadFunctionCallException::class); + $this->entity->something(); } - /** - * @expectedException \BadFunctionCallException - */ + public function testGetterShouldFailIfAttributeNotDefined(){ + $this->expectException(\BadFunctionCallException::class); + $this->entity->getTest(); } - /** - * @expectedException \BadFunctionCallException - */ + public function testSetterShouldFailIfAttributeNotDefined(){ + $this->expectException(\BadFunctionCallException::class); + $this->entity->setTest(); } @@ -245,10 +245,10 @@ class EntityTest extends \Test\TestCase { $this->assertThat($entity->isAnotherBool(), new IsType(IsType::TYPE_BOOL)); } - /** - * @expectedException BadFunctionCallException - */ + public function testIsGetterShoudFailForOtherType() { + $this->expectException(\BadFunctionCallException::class); + $entity = new TestEntity(); $entity->setName('hello'); $this->assertThat($entity->isName(), new IsType(IsType::TYPE_BOOL)); -- cgit v1.2.3