/** * Tests the diseases CRUD * * @return void */ public function testifDiseaseCrudWorks() { // add, edit and delete disease entry Input::replace($this->inputDisease); $config = new ReportController(); $config->disease(); $diseaseModel = Disease::all(); //Check if entry was added $this->assertEquals($diseaseModel[3]->name, $this->inputDisease['new-diseases']['1']['disease']); //Check if entry was edited $this->assertEquals($diseaseModel[0]->name, $this->inputDisease['diseases']['1']['disease']); //Check if entry was deleted - the only available are the three above => one deleted $this->assertEquals(count($diseaseModel), 4); }