/** * This function retrieves a EIS given a EID * * The function receives as inputs SMSR-Id (required) and EID (Optional) * It searches for the EIS in the EIS Model. When no EID is supplied, all EIS are collected. * the function returns a HTTP response object. This response object contains the EIS or error codes. * * @param string $smsrid Required. SMSR in which search for EIS. * @param string $eid Optional. EID of EIS requested. When omitted, all EIS of SMSR are returned * @return Response EIS, collection of EIS or error code * */ public function getEIS($SmsrId, $Eid = null) { $Eis = new Eis(); if ($SmsrId == 'all') { if ($Eid == null) { $result = $Eis->all(); } else { $result = $Eis->find($Eid); } } else { if ($Eid == null) { $result = $Eis->all(); } else { $result = $Eis->getEisFromEid($Eid); } } return response()->json($result); }
/** * test retrieve all EIS */ function testAll() { //arrange $model = new Eis(); //act $result = $model->all(); //assert $this->assertCount(100, $result); }