Exemplo n.º 1
0
 /**
  * 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('testcategory.index')->with('testcategory', $testcategory);
 }
Exemplo n.º 2
0
 /**
  * Tests the update function in the TestCategoryController
  * @param  void
  * @return void
  */
 public function testDelete()
 {
     $this->withoutMiddleware();
     $this->call('POST', '/testcategory', $this->testCategoryData);
     $testCategorystored = TestCategory::orderBy('id', 'desc')->first();
     $this->call('DELETE', '/testcategory/' . $testCategorystored->id . '/delete', $this->testCategoryData);
     $testCategoriesDeleted = TestCategory::withTrashed()->find($testCategorystored->id);
     $this->assertNotNull($testCategoriesDeleted->deleted_at);
 }