コード例 #1
0
 /**
  * Test the sending of EVENT_ENTITY_CREATE signal between entities
  */
 public function testEntityCreateEvent()
 {
     // First entity should not notify anything
     $entity0001 = new ZombieChow(['board' => $this->board]);
     // Second entity should notify the first entity
     $entity0002 = new ZombieChow(['board' => $this->board]);
     // Make sure that first entity has received signal on the second entity creation
     $this->assertEquals($entity0001->getLastSignalReceived()['signal'], EntityEvent::EVENT_ENTITY_CREATE);
     $this->assertEquals($entity0001->getLastSignalReceived()['event']->getEntity()->getId(), $entity0002->getId());
     // Second entity should not have received any notifications
     $this->assertNull($entity0002->getLastSignalReceived()['signal']);
 }