Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function create_WithData_ValidPayload() |
||
31 | { |
||
32 | $this->mockClient() |
||
33 | ->expects($this->once()) |
||
34 | ->method("post") |
||
35 | ->with("contacts", $this->getExpectedPayload('Contacts/create')) |
||
36 | ->willReturn($this->buildResponse('Contacts/create')); |
||
37 | |||
38 | $contact = new Contact('test_last name'); |
||
39 | $contact->setFirstname('Test'); |
||
40 | $contact->setCivilityCode('Mr'); |
||
41 | $contact->setPhone('0000000000'); |
||
42 | $contact->setEmail('[email protected]'); |
||
43 | $contact->setAddress('add'); |
||
44 | $contact->setZip('1000'); |
||
45 | $contact->setCompanyId(1); |
||
46 | $contact->setEnable(true); |
||
47 | $contact->setExternalReference('AZERTY001'); |
||
48 | $contact->setTown('City'); |
||
49 | |||
50 | $id = $this->service->create($contact); |
||
51 | |||
52 | $this->assertInstanceOf(ContactId::class, $id); |
||
53 | $this->assertEquals(4, $id->getId()); |
||
54 | } |
||
56 |