Esempio n. 1
0
 /**
  * @group OrmModels
  * @group PlayerOrm
  */
 public function testPlayerOrmGetSet()
 {
     $rndFiller = new \App\Lib\DsManager\Helpers\RandomFiller();
     $playerM = $rndFiller->getPlayer();
     $arrayPl = $playerM->toArray();
     $playerO = \App\Lib\DsManager\Models\Orm\Player::create($arrayPl);
     $this->assertNotEmpty($playerO);
     $newPlayer = \App\Lib\DsManager\Models\Player::fromArray($playerO->toArray());
     $this->assertNotEmpty($newPlayer);
 }
Esempio n. 2
0
 /**
  * @group Team
  */
 public function testGetRandomTeam()
 {
     $rndF = new \App\Lib\DsManager\Helpers\RandomFiller("it_IT");
     $team = $rndF->getTeam();
     $this->assertNotEmpty($team);
     $this->assertNotEmpty($team->name);
     $this->assertNotEmpty($team->getAvgSkill());
     //After Adding a player
     $player = $rndF->getPlayer();
     $this->assertNotEmpty($player->toArray());
     $team->roster[] = $player;
     $this->assertNotEmpty($team->getAvgSkill());
     $this->assertNotEmpty($team->getAvgAge());
     $this->assertNotEmpty($team->coach->toArray());
     $teamArray = $team->toArray();
     $this->assertNotEmpty($teamArray);
     $newTeam = \App\Lib\DsManager\Models\Team::fromArray($teamArray);
     $this->assertNotEmpty($newTeam->toArray());
 }