-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsultationTest.php
More file actions
43 lines (31 loc) · 1.32 KB
/
Copy pathConsultationTest.php
File metadata and controls
43 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Tests\Prototype;
use PHPUnit\Framework\TestCase;
use App\Prototype\Consultation;
class ConsultationTest extends TestCase
{
public function testConsultation()
{
$patients = ['Maria', 'João', 'Gustavo', 'Fernando'];
$consultationPrototype = new Consultation;
$consultationPrototype->setNameUser("User Name");
$consultationPrototype->setNameDoctor("Doctor Cristiano");
$consultations = [];
foreach ($patients as $patient) {
$consultationCreate = clone $consultationPrototype;
$consultationCreate->setNamePatient($patient);
$consultations[] = $consultationCreate;
}
$this->assertEquals(4, count($consultations));
// First Consultation
$consultation = $consultations[0];
$this->assertEquals("User Name", $consultation->getNameUser());
$this->assertEquals("Doctor Cristiano", $consultation->getNameDoctor());
$this->assertEquals("Maria", $consultation->getNamePatient());
// End Consultation
$consultation = end($consultations);
$this->assertEquals("User Name", $consultation->getNameUser());
$this->assertEquals("Doctor Cristiano", $consultation->getNameDoctor());
$this->assertEquals("Fernando", $consultation->getNamePatient());
}
}