Permalink
Browse files

Don't complain about pre-replaced YAML fixture relations

  • Loading branch information...
1 parent 6028cf1 commit 546d202f3a7d1ac5139f5b9908c67be3d7c427e9 @chillu chillu committed Dec 17, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 dev/FixtureBlueprint.php
View
@@ -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,

0 comments on commit 546d202

Please sign in to comment.