From c6e913a4f084c3047bb9ee9c07d22f65f121ddcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Tue, 9 Jul 2019 13:30:31 +0200 Subject: [PATCH] Test fixes --- .../FieldValue/Converter/ContentTypeListConverter.php | 2 +- Tests/Core/FieldType/ContentTypeList/TypeTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php index 4dbe1c1..fad62f3 100644 --- a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php +++ b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php @@ -31,7 +31,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel */ public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue) { - $data = trim($value->dataText); + $data = trim($value->dataText ?? ''); $fieldValue->data = empty($data) ? [] : explode(',', $data); } diff --git a/Tests/Core/FieldType/ContentTypeList/TypeTest.php b/Tests/Core/FieldType/ContentTypeList/TypeTest.php index 4beeff5..32b166a 100644 --- a/Tests/Core/FieldType/ContentTypeList/TypeTest.php +++ b/Tests/Core/FieldType/ContentTypeList/TypeTest.php @@ -57,7 +57,7 @@ public function testGetFieldTypeIdentifier() public function testGetEmptyValue() { - self::assertSame($this->emptyValue, $this->type->getEmptyValue()); + self::assertSame($this->emptyValue->identifiers, $this->type->getEmptyValue()->identifiers); } public function testGetName() @@ -73,17 +73,17 @@ public function testIsEmptyValue() public function testFromHashWithStringArgument() { - self::assertSame($this->emptyValue, $this->type->fromHash('test')); + self::assertSame($this->emptyValue->identifiers, $this->type->fromHash('test')->identifiers); } public function testFromHashWithArrayOfNumbers() { - self::assertSame($this->emptyValue, $this->type->fromHash([123, 456])); + self::assertSame($this->emptyValue->identifiers, $this->type->fromHash([123, 456])->identifiers); } public function testFromHash() { - self::assertSame($this->value, $this->type->fromHash($this->identifiers)); + self::assertSame($this->value->identifiers, $this->type->fromHash($this->identifiers)->identifiers); } public function testAcceptValueWithArrayOfStringIdentifiers()