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]]; }
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'))); }
public function testAmoutGetter() { $this->sut->setAmount(9.99); $this->assertEquals(9.99, $this->sut->getAmount()); }