From d4c4e9e248115995ca0c80c5a254446865bd5bb4 Mon Sep 17 00:00:00 2001 From: OKINAKA Kenshin Date: Fri, 18 Apr 2014 18:45:08 +0900 Subject: [PATCH] adding test. --- Test/Case/Model/Behavior/TaggableBehaviorTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Test/Case/Model/Behavior/TaggableBehaviorTest.php b/Test/Case/Model/Behavior/TaggableBehaviorTest.php index 1efd437..a3bdf07 100644 --- a/Test/Case/Model/Behavior/TaggableBehaviorTest.php +++ b/Test/Case/Model/Behavior/TaggableBehaviorTest.php @@ -236,7 +236,7 @@ public function testTagArrayToString() { $this->assertTrue(empty($result)); $this->assertInternalType('string', $result); - $data['tags'] = 'cakephp:foo, cakephp:bar'; + $data['tags'] = 'cakephp:foo, cakephp:bar, foo, bar'; $this->Article->save($data, false); $result = $this->Article->find('first', array( 'conditions' => array( @@ -373,4 +373,17 @@ public function testSavingTagsDoesNotCreateEmptyRecords() { $this->assertEquals($count, 0); } +/** + * testSavingTagsWithDefferentIdentifier + * + * @return void + */ + public function testSavingTagsWithDifferentIdentifier() { + $data = $this->Article->findById('article-1'); + $data['Article']['tags'] = 'foo:cakephp, bar:cakephp'; + $this->Article->save($data); + $data = $this->Article->findById('article-1'); + $this->assertEquals('bar:cakephp, foo:cakephp', $data['Article']['tags']); + + } }