Exemplo n.º 1
0
 public function testBasketWithBalls()
 {
     $basketFactory = new Basket\Factory\BasketFactory('Test', 2);
     $basket = $basketFactory->getBasket();
     $numbers = array(1, 2);
     $provider = new Balls\Provider\CustomBallsProvider($numbers);
     $provider->setNumbers($numbers);
     $basketFactory->loadBalls($provider, new Balls\Factory\BallFactory());
     $this->assertEquals($numbers, $basket->getBalls()->toArray());
 }
Exemplo n.º 2
0
 public function getBall()
 {
     if (!count($this->numbers)) {
         $this->setNumbers($this->suckUserBalls());
     }
     return parent::getBall();
 }