| 1 | <?php |
||
| 15 | |||
| 16 | class PhoneChangedEventTest extends TestCase |
||
| 17 | { |
||
| 18 | public function testEventChangePhone() |
||
| 19 | { |
||
| 20 | $person = $this->createMock('LoginCidadao\CoreBundle\Entity\Person'); |
||
| 21 | $phone = $this->createMock('libphonenumber\PhoneNumber'); |
||
| 22 | $event = new PhoneChangedEvent($person, $phone); |
||
| 23 | |||
| 24 | $this->assertEquals($person, $event->getPerson()); |
||
| 25 | $this->assertEquals($phone, $event->getOldPhone()); |
||
| 26 | } |
||
| 27 | |||
| 28 | |||
| 29 | public function testEventSetPhone() |
||
| 30 | { |
||
| 31 | $person = $this->createMock('LoginCidadao\CoreBundle\Entity\Person'); |
||
| 32 | $event = new PhoneChangedEvent($person, null); |
||
| 33 | |||
| 34 | $this->assertEquals($person, $event->getPerson()); |
||
| 35 | $this->assertNull($event->getOldPhone()); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |