public function testRecordCanBeDeletedById() { $object = DbQuerries::deleteById("cars", 1); $this->assertEquals(1, $object); $object1 = DbQuerries::selectAllRecord("cars"); $this->assertEquals(0, count($object1)); }
/** * A method to destroy a record by its id * * @param integer id The id of the record */ public static function destroy($id) { try { $result = DbQuerries::deleteById(static::$table, $id); } catch (\Exception $e) { echo $e->getMessage(); } }