| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | public function testBuildWithMagentoCustomer() |
||
| 17 | { |
||
| 18 | $email = '[email protected]'; |
||
| 19 | $firstName = 'firstName'; |
||
| 20 | $lastName = 'lastName'; |
||
| 21 | |||
| 22 | /** @var MockObject|Customer $magentoCustomer */ |
||
| 23 | $magentoCustomer = $this->createMock(Customer::class); |
||
| 24 | |||
| 25 | $magentoCustomer->expects($this->at(0)) |
||
| 26 | ->method('getData') |
||
| 27 | ->with('email') |
||
| 28 | ->willReturn($email); |
||
| 29 | |||
| 30 | $magentoCustomer->expects($this->at(1)) |
||
| 31 | ->method('getData') |
||
| 32 | ->with('firstname') |
||
| 33 | ->willReturn($firstName); |
||
| 34 | |||
| 35 | $magentoCustomer->expects($this->at(2)) |
||
| 36 | ->method('getData') |
||
| 37 | ->with('lastname') |
||
| 38 | ->willReturn($lastName); |
||
| 39 | |||
| 40 | $expected = [ |
||
| 41 | 'email' => $email, |
||
| 42 | 'firstName' => $firstName, |
||
| 43 | 'lastName' => $lastName |
||
| 44 | ]; |
||
| 45 | |||
| 46 | $this->assertEquals( |
||
| 47 | $expected, |
||
| 48 | (new ContactBuilder())->buildWithMagentoCustomer($magentoCustomer) |
||
| 49 | ); |
||
| 70 |