public function testDeleteById() { $this->mockEngineMethod('deleteById')->with($this->equalTo('table'), $this->equalTo('id'))->will($this->returnValue(true)); $this->assertTrue(DbClient::deleteById('table', 'id')); }
/** * @return void */ public function delete() { if ($this->hasColumn('id')) { DbClient::deleteById(static::getTableName(), $this->getColumn('id')); } else { $class = get_called_class(); throw new DbActiveRecordException("Cannot delete active record '{$class}' which is not persistent, " . "because column 'id' is missing."); } }