Ejemplo n.º 1
0
 /**
  * Tests the update function in the PatientController
  * @depends testStore
  * @param void
  * @return void
  */
 public function testDelete()
 {
     $this->be(User::first());
     $this->runStore($this->input);
     $patientSaved = Patient::orderBy('id', 'desc')->first();
     $patient = new PatientController();
     $patient->delete($patientSaved->id);
     $patientsDeleted = Patient::withTrashed()->find($patientSaved->id);
     $this->assertNotNull($patientsDeleted->deleted_at);
 }
Ejemplo n.º 2
0
 public function testGetGender()
 {
     $data = array(array('patient_number' => '6666', 'name' => 'Paul Mamboleo', 'dob' => '1930-07-05', 'gender' => '0', 'email' => '*****@*****.**', 'address' => 'Godric Hollows', 'phone_number' => '+189012402938', 'created_at' => '0000-00-00', 'updated_at' => '0000-00-00'), array('patient_number' => '5555', 'name' => 'Akellus Judith Pocos Black', 'dob' => '1900-07-05', 'gender' => '1', 'email' => '*****@*****.**', 'address' => '12 Grimmauld Place', 'phone_number' => '+18966602938', 'created_at' => '0000-00-00', 'updated_at' => '0000-00-00'));
     Patient::insert($data);
     $patientSaved = Patient::orderBy('id', 'desc')->take(2)->get()->toArray();
     $patientfemale = Patient::find($patientSaved[0]['id']);
     $patientmale = Patient::find($patientSaved[1]['id']);
     $this->assertEquals('F', $patientfemale->getGender());
     $this->assertEquals('M', $patientmale->getGender());
 }