|
@@ 140-156 (lines=17) @@
|
| 137 |
|
$this->assertSame(self::TEST_NAME, (string)$this->entity); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
public function testAddDuplicatePhone() |
| 141 |
|
{ |
| 142 |
|
$customer = new B2bCustomer(); |
| 143 |
|
$firstPhone = new B2bCustomerPhone('06001122334455'); |
| 144 |
|
$secondPhone = new B2bCustomerPhone('07001122334455'); |
| 145 |
|
$customerPhones = [$firstPhone, $secondPhone]; |
| 146 |
|
|
| 147 |
|
$customer->resetPhones($customerPhones); |
| 148 |
|
|
| 149 |
|
$actual = $customer->getPhones(); |
| 150 |
|
$this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $actual); |
| 151 |
|
$this->assertEquals($customerPhones, $actual->toArray()); |
| 152 |
|
$customer->addPhone($secondPhone); |
| 153 |
|
|
| 154 |
|
$actual = $customer->getPhones(); |
| 155 |
|
$this->assertEquals($customerPhones, $actual->toArray()); |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
public function testAddNewPhone() |
| 159 |
|
{ |
|
@@ 215-231 (lines=17) @@
|
| 212 |
|
$this->assertFalse($firstPhone->isPrimary()); |
| 213 |
|
} |
| 214 |
|
|
| 215 |
|
public function testAddDuplicateEmail() |
| 216 |
|
{ |
| 217 |
|
$customer = new B2bCustomer(); |
| 218 |
|
$firstEmail = new B2bCustomerEmail('[email protected]'); |
| 219 |
|
$secondEmail = new B2bCustomerEmail('[email protected]'); |
| 220 |
|
$customerEmails = [$firstEmail, $secondEmail]; |
| 221 |
|
|
| 222 |
|
$customer->resetEmails($customerEmails); |
| 223 |
|
|
| 224 |
|
$actual = $customer->getEmails(); |
| 225 |
|
$this->assertInstanceOf('Doctrine\Common\Collections\ArrayCollection', $actual); |
| 226 |
|
$this->assertEquals($customerEmails, $actual->toArray()); |
| 227 |
|
$customer->addEmail($secondEmail); |
| 228 |
|
|
| 229 |
|
$actual = $customer->getEmails(); |
| 230 |
|
$this->assertEquals($customerEmails, $actual->toArray()); |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
public function testAddNewEmail() |
| 234 |
|
{ |