public function testDeleteApi() { // Delete the published definition for each test csv file. foreach ($this->test_data as $file) { $this->updateRequest('DELETE'); $controller = \App::make('Tdt\\Core\\Definitions\\DefinitionController'); $response = $controller->handle("csv/{$file}"); $this->assertEquals(200, $response->getStatusCode()); } // Check if everything is deleted properly. $definitions_count = \Definition::all()->count(); $csv_count = \CsvDefinition::all()->count(); $this->assertTrue($csv_count == 0); $this->assertTrue($definitions_count == 0); }