Changeset 8023
- Timestamp:
- 03/21/08 13:15:15 (7 months ago)
- Files:
-
- plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/config/config.php (modified) (2 diffs)
- plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/lib/sfPropelActAsTaggableBehavior.class.php (modified) (1 diff)
- plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/test/unit/sfPropelActAsTaggableBehaviorTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/config/config.php
r4083 r8023 2 2 /* 3 3 * This file is part of the sfPropelActAsTaggableBehavior package. 4 * 4 * 5 5 * (c) 2007 Xavier Lacot <xavier@lacot.org> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. … … 39 39 'replaceTag' 40 40 ), 41 array ( 42 'sfPropelActAsTaggableBehavior', 43 'setTags' 44 ), 41 45 )); plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/lib/sfPropelActAsTaggableBehavior.class.php
r8022 r8023 485 485 } 486 486 } 487 488 /** 489 * Sets the tags of an object. As usual, the second parameter might be an 490 * array of tags or a comma-separated string. 491 * 492 * @param BaseObject $object 493 * @param mixed $tagname 494 */ 495 public function setTags(BaseObject $object, $tagname) 496 { 497 $this->removeAllTags($object); 498 $this->addTag($object, $tagname); 499 } 487 500 } plugins/sfPropelActAsTaggableBehaviorPlugin/trunk/test/unit/sfPropelActAsTaggableBehaviorTest.php
r7390 r8023 40 40 41 41 // start tests 42 $t = new lime_test(5 3, new lime_output_color());42 $t = new lime_test(54, new lime_output_color()); 43 43 44 44 … … 190 190 $object_tags = $object->getTags(); 191 191 $t->ok((count($object_tags) == 2) && $object->hasTag('tutu') && $object->hasTag('titi'), 'tags can be added with an array.'); 192 193 $object->setTags('wallace, gromit'); 194 $object_tags = $object->getTags(); 195 $t->ok((count($object_tags) == 2) && $object->hasTag('wallace') && $object->hasTag('gromit'), 'tags can be set directly using setTags().'); 192 196 193 197 unset($object);