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
 public function testCreateTicketFromPayment()
 {
     $fee = new EntranceFee();
     $fee->setAmount(1000);
     $fee->setCurrency('JPY');
     $fee->setDurationValue(12);
     // 12 months
     $this->repository->expects($this->once())->method('findOne')->with(['-class' => 'fee'])->willReturn($fee);
     $ticket = $this->sut->createTicketFromPayment();
     $this->assertInstanceOf('Trismegiste\\SocialBundle\\Ticket\\Ticket', $ticket);
     $this->assertTrue($ticket->isValid());
     $this->assertTrue($ticket->isValid(new \DateTime('+11 months')));
     $this->assertFalse($ticket->isValid(new \DateTime('+13 months')));
 }
Exemplo n.º 3
0
 public function testCurrencyGetter()
 {
     $this->sut->setCurrency('EUR');
     $this->assertEquals('EUR', $this->sut->getCurrency());
 }