From 546d202f3a7d1ac5139f5b9908c67be3d7c427e9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 17 Dec 2012 15:33:12 +0100 Subject: [PATCH] Don't complain about pre-replaced YAML fixture relations --- dev/FixtureBlueprint.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/FixtureBlueprint.php b/dev/FixtureBlueprint.php index 0b01458d694..c3cc97c4e54 100644 --- a/dev/FixtureBlueprint.php +++ b/dev/FixtureBlueprint.php @@ -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: =>. - if(!preg_match('/^=>[^\.]+\.[^\.]+/', $item)) { + // Check for correct format: =>.. + // 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,