Exemplo n.º 1
0
 public function getValidInputs()
 {
     $obj = new EntranceFee();
     $obj->setAmount(9.99);
     $obj->setCurrency('USD');
     $obj->setDurationValue(12);
     return [[['amount' => 9.99, 'currency' => 'USD', 'durationValue' => 12], $obj]];
 }
Exemplo n.º 2
0
 protected function addUserFixture($nickname, $uid = '123456789')
 {
     $user = $this->getService('security.netizen.factory')->create($nickname, 'dummy', $uid);
     $fee = new EntranceFee();
     $fee->setDurationValue(12);
     $user->addTicket(new Ticket($fee));
     $prof = $user->getProfile();
     $prof->fullName = ucfirst($nickname);
     $prof->gender = 'xy';
     $prof->dateOfBirth = DateTime::createFromFormat(DateTime::ISO8601, '1918-10-11T00:00:00Z');
     $prof->email = $nickname . '@server.tld';
     $this->getService('social.netizen.repository')->persist($user);
 }
Exemplo n.º 3
0
 public function testPersistNewPayment()
 {
     $fee = new EntranceFee();
     $fee->setDurationValue(12);
     $ticket = new Ticket($fee);
     $this->repository->expects($this->once())->method('persist');
     $this->user->expects($this->once())->method('addTicket');
     $this->sut->persistNewPayment($ticket);
 }
Exemplo n.º 4
0
 public function testDurationGetter()
 {
     $this->sut->setDurationValue(12);
     $this->assertEquals(12, $this->sut->getDurationValue());
     $this->assertEquals('+12 month', $this->sut->getDurationOffset());
 }