category short name

This commit is contained in:
John Bintz 2009-11-23 08:24:00 -05:00
parent 1c298f4105
commit 6f5d8c620f
2 changed files with 8 additions and 1 deletions

View File

@ -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}"})) {

View File

@ -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')
),
);
}