Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
adding test.
Browse files Browse the repository at this point in the history
  • Loading branch information
okinaka committed Apr 18, 2014
1 parent 2bba473 commit d4c4e9e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Test/Case/Model/Behavior/TaggableBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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']);

}
}

0 comments on commit d4c4e9e

Please sign in to comment.