addQuerySpec() public method

Set the result of a query that may be called in the future
public addQuerySpec ( array $spec ) : integer
$spec array Query spec
return integer ID of spec
Example #1
0
 public function testCanRemoveSubtype()
 {
     $dbprefix = elgg_get_config('dbprefix');
     $this->setupFetchAllQuery();
     $type = 'object';
     $subtype = 'foo';
     $this->db->addQuerySpec(['sql' => "\n\t\t\t\tDELETE FROM {$dbprefix}entity_subtypes\n\t\t\t\tWHERE type = :type AND subtype = :subtype\n\t\t\t", 'params' => [':type' => $type, ':subtype' => $subtype], 'row_count' => 1]);
     $this->assertTrue(_elgg_services()->subtypeTable->remove($type, $subtype));
     $this->db->addQuerySpec(['sql' => "\n\t\t\t\tDELETE FROM {$dbprefix}entity_subtypes\n\t\t\t\tWHERE type = :type AND subtype = :subtype\n\t\t\t", 'params' => [':type' => $type, ':subtype' => 'unregistered'], 'row_count' => 0]);
     $this->assertFalse(_elgg_services()->subtypeTable->remove($type, 'unregistered'));
 }