tests: Avoid using dynamic properties

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-23 07:37:14 +01:00
parent 843afb19ea
commit 9867f2a856
12 changed files with 35 additions and 6 deletions

View File

@@ -23,18 +23,22 @@
namespace OCA\Deck\Db;
class MyRelationalEntity extends RelationalEntity {
protected $foo;
}
class RelationalEntityTest extends \Test\TestCase {
public function testRelation() {
$entity = new RelationalEntity();
$entity->foo = null;
$entity = new MyRelationalEntity();
$entity->setFoo(null);
$entity->addRelation('foo');
$entity->setFoo('test');
$this->assertEquals([], $entity->getUpdatedFields());
}
public function testWithoutRelation() {
$entity = new RelationalEntity();
$entity->foo = null;
$entity = new MyRelationalEntity();
$entity->setFoo(null);
$entity->setFoo('test');
$this->assertEquals(['foo' => true], $entity->getUpdatedFields());
}