Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Jul 9, 2019
1 parent a6b3b0f commit c6e913a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions Tests/Core/FieldType/ContentTypeList/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit c6e913a

Please sign in to comment.