| @@ 42-56 (lines=15) @@ | ||
| 39 | $this->assertInstanceOf('\DateTime', $entity->getUpdatedAt()); |
|
| 40 | } |
|
| 41 | ||
| 42 | public function testAddContact() |
|
| 43 | { |
|
| 44 | $account = new Account(); |
|
| 45 | $account->setId(1); |
|
| 46 | ||
| 47 | $contact = new Contact(); |
|
| 48 | $contact->setId(2); |
|
| 49 | ||
| 50 | $this->assertEmpty($account->getContacts()->toArray()); |
|
| 51 | ||
| 52 | $account->addContact($contact); |
|
| 53 | $actualContacts = $account->getContacts()->toArray(); |
|
| 54 | $this->assertCount(1, $actualContacts); |
|
| 55 | $this->assertEquals($contact, current($actualContacts)); |
|
| 56 | } |
|
| 57 | ||
| 58 | public function testRemoveContact() |
|
| 59 | { |
|
| @@ 58-71 (lines=14) @@ | ||
| 55 | $this->assertEquals($contact, current($actualContacts)); |
|
| 56 | } |
|
| 57 | ||
| 58 | public function testRemoveContact() |
|
| 59 | { |
|
| 60 | $account = new Account(); |
|
| 61 | $account->setId(1); |
|
| 62 | ||
| 63 | $contact = new Contact(); |
|
| 64 | $contact->setId(2); |
|
| 65 | ||
| 66 | $account->addContact($contact); |
|
| 67 | $this->assertCount(1, $account->getContacts()->toArray()); |
|
| 68 | ||
| 69 | $account->removeContact($contact); |
|
| 70 | $this->assertEmpty($account->getContacts()->toArray()); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function testOwners() |
|
| 74 | { |
|
| @@ 48-62 (lines=15) @@ | ||
| 45 | $this->assertEquals('Group One, Group Two', $entity->getGroupLabelsAsString()); |
|
| 46 | } |
|
| 47 | ||
| 48 | public function testAddAccount() |
|
| 49 | { |
|
| 50 | $account = new Account(); |
|
| 51 | $account->setId(1); |
|
| 52 | ||
| 53 | $contact = new Contact(); |
|
| 54 | $contact->setId(2); |
|
| 55 | ||
| 56 | $this->assertEmpty($contact->getAccounts()->toArray()); |
|
| 57 | ||
| 58 | $contact->addAccount($account); |
|
| 59 | $actualAccounts = $contact->getAccounts()->toArray(); |
|
| 60 | $this->assertCount(1, $actualAccounts); |
|
| 61 | $this->assertEquals($account, current($actualAccounts)); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function testRemoveAccount() |
|
| 65 | { |
|
| @@ 64-77 (lines=14) @@ | ||
| 61 | $this->assertEquals($account, current($actualAccounts)); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function testRemoveAccount() |
|
| 65 | { |
|
| 66 | $account = new Account(); |
|
| 67 | $account->setId(1); |
|
| 68 | ||
| 69 | $contact = new Contact(); |
|
| 70 | $contact->setId(2); |
|
| 71 | ||
| 72 | $contact->addAccount($account); |
|
| 73 | $this->assertCount(1, $contact->getAccounts()->toArray()); |
|
| 74 | ||
| 75 | $contact->removeAccount($account); |
|
| 76 | $this->assertEmpty($contact->getAccounts()->toArray()); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testEmails() |
|
| 80 | { |
|