aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Db/EntityTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Db/EntityTest.php')
-rw-r--r--tests/lib/AppFramework/Db/EntityTest.php46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php
index a521b480f8f..c426faa757d 100644
--- a/tests/lib/AppFramework/Db/EntityTest.php
+++ b/tests/lib/AppFramework/Db/EntityTest.php
@@ -59,7 +59,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testResetUpdatedFields() {
+ public function testResetUpdatedFields(): void {
$entity = new TestEntity();
$entity->setId(3);
$entity->resetUpdatedFields();
@@ -68,7 +68,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testFromRow() {
+ public function testFromRow(): void {
$row = [
'pre_name' => 'john',
'email' => 'john@something.com'
@@ -80,7 +80,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetSetId() {
+ public function testGetSetId(): void {
$id = 3;
$this->entity->setId(3);
@@ -88,28 +88,28 @@ class EntityTest extends \Test\TestCase {
}
- public function testColumnToPropertyNoReplacement() {
+ public function testColumnToPropertyNoReplacement(): void {
$column = 'my';
$this->assertEquals('my',
$this->entity->columnToProperty($column));
}
- public function testColumnToProperty() {
+ public function testColumnToProperty(): void {
$column = 'my_attribute';
$this->assertEquals('myAttribute',
$this->entity->columnToProperty($column));
}
- public function testPropertyToColumnNoReplacement() {
+ public function testPropertyToColumnNoReplacement(): void {
$property = 'my';
$this->assertEquals('my',
$this->entity->propertyToColumn($property));
}
- public function testSetterMarksFieldUpdated() {
+ public function testSetterMarksFieldUpdated(): void {
$this->entity->setId(3);
$this->assertContains('id', array_keys($this->entity->getUpdatedFields()));
@@ -117,7 +117,7 @@ class EntityTest extends \Test\TestCase {
- public function testCallShouldOnlyWorkForGetterSetter() {
+ public function testCallShouldOnlyWorkForGetterSetter(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->something();
@@ -125,21 +125,21 @@ class EntityTest extends \Test\TestCase {
- public function testGetterShouldFailIfAttributeNotDefined() {
+ public function testGetterShouldFailIfAttributeNotDefined(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->getTest();
}
- public function testSetterShouldFailIfAttributeNotDefined() {
+ public function testSetterShouldFailIfAttributeNotDefined(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->setTest();
}
- public function testFromRowShouldNotAssignEmptyArray() {
+ public function testFromRowShouldNotAssignEmptyArray(): void {
$row = [];
$entity2 = new TestEntity();
@@ -148,7 +148,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testIdGetsConvertedToInt() {
+ public function testIdGetsConvertedToInt(): void {
$row = ['id' => '4'];
$this->entity = TestEntity::fromRow($row);
@@ -156,7 +156,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testSetType() {
+ public function testSetType(): void {
$row = ['testId' => '4'];
$this->entity = TestEntity::fromRow($row);
@@ -164,7 +164,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testFromParams() {
+ public function testFromParams(): void {
$params = [
'testId' => 4,
'email' => 'john@doe'
@@ -177,7 +177,7 @@ class EntityTest extends \Test\TestCase {
$this->assertTrue($entity instanceof TestEntity);
}
- public function testSlugify() {
+ public function testSlugify(): void {
$entity = new TestEntity();
$entity->setName('Slugify this!');
$this->assertEquals('slugify-this', $entity->slugify('name'));
@@ -186,20 +186,20 @@ class EntityTest extends \Test\TestCase {
}
- public function testSetterCasts() {
+ public function testSetterCasts(): void {
$entity = new TestEntity();
$entity->setId('3');
$this->assertSame(3, $entity->getId());
}
- public function testSetterDoesNotCastOnNull() {
+ public function testSetterDoesNotCastOnNull(): void {
$entity = new TestEntity();
$entity->setId(null);
$this->assertSame(null, $entity->getId());
}
- public function testSetterConvertsResourcesToStringProperly() {
+ public function testSetterConvertsResourcesToStringProperly(): void {
$string = 'Definitely a string';
$stream = fopen('php://memory', 'r+');
fwrite($stream, $string);
@@ -212,7 +212,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetFieldTypes() {
+ public function testGetFieldTypes(): void {
$entity = new TestEntity();
$this->assertEquals([
'id' => 'integer',
@@ -224,20 +224,20 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetItInt() {
+ public function testGetItInt(): void {
$entity = new TestEntity();
$entity->setId(3);
$this->assertEquals('integer', gettype($entity->getId()));
}
- public function testFieldsNotMarkedUpdatedIfNothingChanges() {
+ public function testFieldsNotMarkedUpdatedIfNothingChanges(): void {
$entity = new TestEntity('hey');
$entity->setName('hey');
$this->assertEquals(0, count($entity->getUpdatedFields()));
}
- public function testIsGetter() {
+ public function testIsGetter(): void {
$entity = new TestEntity();
$entity->setTrueOrFalse(false);
$entity->setAnotherBool(false);
@@ -246,7 +246,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testIsGetterShoudFailForOtherType() {
+ public function testIsGetterShoudFailForOtherType(): void {
$this->expectException(\BadFunctionCallException::class);
$entity = new TestEntity();