public function testLesserHealOnMinionWithFullHealth()
 {
     // Create a zombie chow
     $entity = new ZombieChow(['board' => $this->board, 'owner' => $this->board->getMe()]);
     // Make sure health == 3
     $this->assertEquals(3, $entity->getHealth());
     // Use the hero power
     $this->board->getMe()->getHero()->useHeroPower($entity);
     // Make sure health == 3
     $this->assertEquals(3, $entity->getHealth());
 }
Exemplo n.º 2
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']);
 }
 public function testDeathrattleNotTriggeringWhenSilenced()
 {
     $entity = new ZombieChow(['board' => $this->board, 'owner' => $this->board->getMe()]);
     // Hero take some damage, from 30 (base) - 10 = 20.
     $this->board->getOpponent()->getHero()->takeDamage(10);
     // Assert that enemy hero health is 20
     $this->assertEquals(20, $this->board->getOpponent()->getHero()->getHealth());
     // Silence minion
     $entity->silence();
     // Destroy minion, deathrattle should not trigger now
     $entity->destroy();
     // Assert that enemy hero health is the same == 20
     $this->assertEquals(20, $this->board->getOpponent()->getHero()->getHealth());
 }