コード例 #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]];
 }
コード例 #2
0
ファイル: WebTestCasePlus.php プロジェクト: xtrasmal/iinano
 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);
 }
コード例 #3
0
ファイル: TicketRepository.php プロジェクト: xtrasmal/iinano
 /**
  * Persists the unique fee
  *
  * @param EntranceFee $fee
  */
 public function persistEntranceFee(EntranceFee $fee)
 {
     $dbFee = $this->findEntranceFee();
     if (is_null($dbFee) || $dbFee->getId() === $fee->getId()) {
         $this->repository->persist($fee);
     } else {
         throw new \DomainException('Only one unique Fee must be configured');
     }
 }
コード例 #4
0
 public function testPersistExistingFee()
 {
     $fee = new EntranceFee();
     $fee->setId(new \MongoId());
     $this->repository->expects($this->once())->method('findOne')->with(['-class' => 'fee'])->willReturn($fee);
     $this->repository->expects($this->once())->method('persist')->with($fee);
     $this->sut->persistEntranceFee($fee);
 }
コード例 #5
0
ファイル: EntraceFeeTest.php プロジェクト: xtrasmal/iinano
 public function testTitle()
 {
     $this->assertStringStartsWith('payment', $this->sut->getTitle());
 }