Пример #1
0
 public function testHit()
 {
     $firstLifespan = $this->game->getPlayer()->getLifespan();
     $this->drone->hit($this->game->getPlayer());
     $secondLifespan = $this->game->getPlayer()->getLifespan();
     $this->assertLessThan($firstLifespan, $secondLifespan);
 }
Пример #2
0
 /**
  * @depends testHeal
  */
 public function testBeforeTakeHit()
 {
     $this->game->getCharacterPool()->searchBee()->takeHit(100);
     $expected = $this->game->getCharacterPool()->searchBee()->getLifespan();
     $this->game->getCharacterPool()->searchBee()->beforeTakeHit();
     $actual = $this->game->getCharacterPool()->searchBee()->getLifespan();
     $this->assertGreaterThan($expected, $actual);
 }
Пример #3
0
 public function testBeforeTakeHit()
 {
     /** @var Worker $bee */
     $bee = $this->game->getCharacterPool()->searchBee();
     $expected = $this->game->getHoneyPool()->amount();
     $bee->beforeTakeHit();
     $actual = $this->game->getHoneyPool()->amount();
     $this->assertGreaterThan($expected, $actual);
 }
Пример #4
0
 public function testFinishStartedGameWithBeesAndEmptyPlayerReturnLose()
 {
     $this->game->getCharacterPool()->addBee(new Drone($this->game));
     $this->game->start();
     $this->game->getPlayer()->toDie();
     $this->assertEquals(GameResultInterface::RESULT_LOSE, $this->game->finish());
 }
Пример #5
0
 public function testKillAll()
 {
     $this->queen->killAllBees();
     $this->assertCount(0, $this->game->getCharacterPool()->getBees());
 }
Пример #6
0
 /**
  * @depends testGet
  */
 public function testSave()
 {
     $this->game->getCharacterPool()->killAllBees();
     $this->sessionStub->expects($this->once())->method('set')->with('game', serialize($this->game))->willReturn(true);
     $this->storage->save($this->game);
 }
Пример #7
0
 public static function setUpBeforeClass()
 {
     self::$game = GameWithoutCharacters::get();
     self::$pool = self::$game->getCharacterPool();
 }