From 6f5d8c620f4697feb0be19b6e69131480a6a541c Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 23 Nov 2009 08:24:00 -0500 Subject: [PATCH] category short name --- classes/PostFixtures.inc | 5 ++++- test/PostFixturesTest.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index ed4cdfa..7a46e37 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -209,7 +209,10 @@ class PostFixtures { $value = $matches[0]; $parts = explode(':', $matches[1]); if (count($parts) > 1) { - $source = array_shift($parts); + $source = strtolower(array_shift($parts)); + switch ($source) { + case 'cat': $source = 'category'; break; + } if (count($parts) == 1) { $index = reset($parts); if (isset($this->{"_${source}"})) { diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index c07c061..884d827 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -255,6 +255,10 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { array('test' => '${category:category}'), array('test' => '1') ), + array( + array('test' => '${cat:category}'), + array('test' => '1') + ), ); }