Skip to content

Commit

Permalink
Don't complain about pre-replaced YAML fixture relations
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Dec 17, 2012
1 parent 6028cf1 commit 546d202
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dev/FixtureBlueprint.php
Expand Up @@ -129,8 +129,9 @@ public function createObject($identifier, $data = null, $fixtures = null) {
$parsedItems = array();
$items = preg_split('/ *, */',trim($fieldVal));
foreach($items as $item) {
// Check for correct format: =><relationname>.<identifier>
if(!preg_match('/^=>[^\.]+\.[^\.]+/', $item)) {
// Check for correct format: =><relationname>.<identifier>.
// Ignore if the item has already been replaced with a numeric DB identifier
if(!is_numeric($item) && !preg_match('/^=>[^\.]+\.[^\.]+/', $item)) {
throw new InvalidArgumentException(sprintf(
'Invalid format for relation "%s" on class "%s" ("%s")',
$fieldName,
Expand Down

0 comments on commit 546d202

Please sign in to comment.