示例#1
0
 public function testAddUniqueOnField()
 {
     $obj = new LeanObject("TestObject");
     $obj->addUnique("tags", "frontend");
     $this->assertEquals(array("frontend"), $obj->get("tags"));
     $obj->addUnique("tags", "frontend");
     $this->assertEquals(array("frontend"), $obj->get("tags"));
     $obj->addUnique("tags", "javascript");
     $this->assertEquals(array("frontend", "javascript"), $obj->get("tags"));
 }