mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
YAML comma seperated => lists should work on has_meny relationships as well
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47732 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d27937f448
commit
144f0fc33e
@ -123,13 +123,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
foreach($items as $identifier => $fields) {
|
||||
$obj = new $dataClass();
|
||||
foreach($fields as $fieldName => $fieldVal) {
|
||||
if($obj->many_many($fieldName)) {
|
||||
if($obj->many_many($fieldName) || $obj->has_many($fieldName)) {
|
||||
$items = split(' *, *',trim($fieldVal));
|
||||
foreach($items as $item) {
|
||||
$parsedItems[] = $this->parseFixtureVal($item);
|
||||
}
|
||||
$obj->write();
|
||||
$obj->$fieldName()->setByIdList($parsedItems);
|
||||
$obj->getComponents($fieldName)->setByIDList($parsedItems);
|
||||
|
||||
} else {
|
||||
$obj->$fieldName = $this->parseFixtureVal($fieldVal);
|
||||
|
Loading…
Reference in New Issue
Block a user