Beispiel #1
0
 /**
  * Convenience method to add a delete by ID command.
  *
  * If you need more control, like choosing a key for the command you need to
  * create you own command instance and use the add method.
  *
  * @param int|string $id
  *
  * @return self Provides fluent interface
  */
 public function addDeleteById($id)
 {
     $delete = new DeleteCommand();
     $delete->addId($id);
     return $this->add(null, $delete);
 }
 public function testBuildDeleteXmlIdAndQuerySpecialChars()
 {
     $command = new DeleteCommand();
     $command->addId('special<char>id');
     $command->addQuery('id:special<char>id');
     $this->assertEquals('<delete><id>special&lt;char&gt;id</id><query>id:special&lt;char&gt;id</query></delete>', $this->builder->buildDeleteXml($command));
 }