public function testDelete() { $table = new Table(__DIR__ . '/data/sample.json'); $table->delete(['_id' => '2']); $this->assertSame([['_id' => '1', 'name' => 'foo']], $table->find()); $table->delete(['name' => 'boo']); $this->assertSame([['_id' => '1', 'name' => 'foo']], $table->find()); $table->delete(['name' => 'foo']); $this->assertSame([], $table->find()); }
public function testDelete() { $this->table->delete(array("id!=" => 0)); $this->assertCount(0, $this->table->find()); }
/** * Remove the specified resource from storage. * DELETE /table/{id} * * @param int $id * @return Response */ public function destroy($id) { Table::find($id)->delete(); return Response::json(['data' => 'Table deleted'], 200); }