/** * Display a listing of the resource. * * @return Response */ public function index() { // List all the active testtypes $testtypes = TestType::orderBy('name', 'ASC')->get(); // Load the view and pass the testtypes return view('testtype.index', compact('testtypes')); }
public function testCountPerStatus() { $this->withoutMiddleware(); $this->call('POST', '/testtype', $this->testTypeData); $testTypestored = TestType::orderBy('id', 'desc')->first(); $testTypeSaved = TestType::find($testTypestored->id); $count = $testTypeSaved->countPerStatus([Test::NOT_RECEIVED, Test::STARTED, Test::PENDING, Test::COMPLETED, Test::VERIFIED]); $this->assertEquals($testTypeSaved->tests->count(), $count); }