Skip to content

Commit

Permalink
Merge pull request #11 from ezsystems/EZP-24648
Browse files Browse the repository at this point in the history
EZP-24648: Get XMLText to pass on namable tests
  • Loading branch information
andrerom committed Apr 13, 2016
2 parents 390ffe6 + 5afb49f commit 8785d62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/FieldType/XmlText/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getName(SPIValue $value)
$result = $value->xml->documentElement->textContent;
}

return trim($result);
return trim(preg_replace(array('/\n/', '/\s\s+/'), ' ', $result));
}

/**
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/XmlTextAPIIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ public function getValidCreationFieldData()
return new XmlTextValue($doc);
}

/**
* Get name generated by the given field type (either via Nameable or fieldType->getName()).
*
* @return string
*/
public function getFieldName()
{
return 'Example link1 link2';
}

/**
* Asserts that the field data was loaded correctly.
*
Expand Down

0 comments on commit 8785d62

Please sign in to comment.