/** * 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::make('testtype.index')->with('testtypes', $testtypes); }
public function testCountPerStatus() { Input::replace($this->testTypeData); $testType = new TestTypeController(); $testType->store(); $testTypestored = TestType::orderBy('id', 'desc')->take(1)->get()->toArray(); $testTypeSaved = TestType::find($testTypestored[0]['id']); $count = $testTypeSaved->countPerStatus([Test::NOT_RECEIVED, Test::STARTED, Test::PENDING, Test::COMPLETED, Test::VERIFIED]); $this->assertEquals($testTypeSaved->tests->count(), $count); }