Skip to content

Instantly share code, notes, and snippets.

@RomainMazB
Created March 31, 2020 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RomainMazB/727412f9aa875f3ffebb99399af96e79 to your computer and use it in GitHub Desktop.
Save RomainMazB/727412f9aa875f3ffebb99399af96e79 to your computer and use it in GitHub Desktop.
public function testUserCanGetAllAchievements(): void
{
for($i = 0; $i < 3; $i++) {
$this->city->buildings->nursery->populate(10, 'warrior');
$this->city->buildings->nursery->sacrifyEggs(10, 'egg');
}
$larvae_offset = config('game.total_development_time.end') - config('game.development_times.larvae.end') + 25;
for($i = 0; $i < 3; $i++) {
$this->city->buildings->nursery->populate(10, 'warrior');
// Update the born_time to make them Larvae
DB::update("UPDATE ants SET born_time = NOW() + CONCAT(?::INT, ' minutes')::INTERVAL", [$larvae_offset]);
$this->city->buildings->nursery->sacrifyEggs(10, 'larvae');
}
$larvae_offset = config('game.total_development_time.end') - config('game.development_times.pupae.end') + 25;
for($i = 0; $i < 3; $i++) {
$this->city->buildings->nursery->populate(10, 'warrior');
// Update the born_time to make them Larvae
DB::update("UPDATE ants SET born_time = NOW() + CONCAT(?::INT, ' minutes')::INTERVAL", [$larvae_offset]);
$this->city->buildings->nursery->sacrifyEggs(10, 'pupae');
}
$this->assertCount(4, $this->city->buildings->royal_room->getAllAchievements());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment