Beispiel #1
0
 /**
  * Tests the getters and setters of the model
  * @test
  */
 public function setGetTest()
 {
     $name = "Testoffer";
     $amount = 4200;
     $currency = "EUR";
     $interval = "1 WEEK";
     $trialPeriodDays = 0;
     $active = 3;
     $inactive = 0;
     $this->_offer->setName($name)->setAmount($amount)->setCurrency($currency)->setInterval($interval)->setTrialPeriodDays($trialPeriodDays)->setSubscriptionCount($active, $inactive);
     $this->assertEquals($this->_offer->getName(), $name);
     $this->assertEquals($this->_offer->getAmount(), $amount);
     $this->assertEquals($this->_offer->getCurrency(), $currency);
     $this->assertEquals($this->_offer->getInterval(), $interval);
     $this->assertEquals($this->_offer->getTrialPeriodDays(), $trialPeriodDays);
     $this->assertEquals($this->_offer->getSubscriptionCount(), array('active' => $active, 'inactive' => $inactive));
 }
Beispiel #2
0
 /**
  * Creates and fills a offermodel
  *
  * @param array $response
  * @return \Paymill\Models\Response\Offer
  */
 private function _createOffer($response)
 {
     $model = new Models\Offer();
     $model->setId($response['id']);
     $model->setName($response['name']);
     $model->setAmount($response['amount']);
     $model->setCurrency($response['currency']);
     $model->setInterval($response['interval']);
     $model->setTrialPeriodDays($response['trial_period_days']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     $model->setSubscriptionCount($response['subscription_count']['active'], $response['subscription_count']['inactive']);
     $model->setAppId($response['app_id']);
     return $model;
 }