/** * Display a listing of the resource. * * @return Response */ public function index() { //List all test categories $testcategory = TestCategory::orderBy('name', 'ASC')->get(); //Load the view and pass the test categories return View::make('testcategory.index')->with('testcategory', $testcategory); }
/** * Tests the update function in the TestCategoryController * @param void * @return void */ public function testDelete() { Input::replace($this->testCategoryData); $testCategory = new TestCategoryController(); $testCategory->store(); $testCategorystored = TestCategory::orderBy('id', 'desc')->take(1)->get()->toArray(); $testCategory->delete($testCategorystored[0]['id']); $testCategoriesDeleted = TestCategory::withTrashed()->find($testCategorystored[0]['id']); $this->assertNotNull($testCategoriesDeleted->deleted_at); }