Beispiel #1
0
 public function testInstanceOfPerSetters()
 {
     $like = new Like();
     $this->assertInstanceOf('Zend\\Db\\Sql\\Predicate\\Like', $like->setIdentifier('bar'));
     $this->assertInstanceOf('Zend\\Db\\Sql\\Predicate\\Like', $like->setSpecification('%1$s LIKE %2$s'));
     $this->assertInstanceOf('Zend\\Db\\Sql\\Predicate\\Like', $like->setLike('foo%'));
 }
Beispiel #2
0
 public function testAccessorsMutators()
 {
     $like = new Like();
     $like->setIdentifier('bar');
     $this->assertEquals('bar', $like->getIdentifier());
     $like->setLike('foo%');
     $this->assertEquals('foo%', $like->getLike());
     $like->setSpecification('target = target');
     $this->assertEquals('target = target', $like->getSpecification());
 }
Beispiel #3
0
 /**
  *	Like
  *	like(In Expression)
  */
 public function like($identifier = NULL, $like = NULL)
 {
     $return = array();
     if ($identifier === NULL or $identifier === '') {
         $identifier = $this->getStructure();
     }
     $value = $this->extractOperation($identifier, $like);
     $return = array();
     foreach ($value as $array) {
         $like = new Like();
         $like->setIdentifier($array[0]);
         $like->setLike($array[1]);
         array_push($return, $like);
     }
     return $return;
 }