Beispiel #1
0
 /**
  * Test the Parameterize function of the model
  * @test
  * @depends setGetTest
  */
 public function parameterizeTest(Request\Offer $offer)
 {
     $testId = "offer_88a388d9dd48f86c3136";
     $offer->setId($testId);
     $creationArray = $offer->parameterize("create");
     $offer->setUpdateSubscriptions(true);
     $updateArray = $offer->parameterize("update");
     $getOneArray = $offer->parameterize("getOne");
     $this->assertEquals($creationArray, array('amount' => 4200, 'currency' => 'EUR', 'interval' => '1 MONTH', 'name' => 'Test Offer', 'trial_period_days' => null));
     $expectedUpdateArray = array('name' => $offer->getName(), 'amount' => $offer->getAmount(), 'currency' => $offer->getCurrency(), 'interval' => $offer->getInterval(), 'trial_period_days' => $offer->getTrialPeriodDays(), 'update_subscriptions' => $offer->getUpdateSubscriptions());
     $this->assertEquals($expectedUpdateArray, $updateArray);
     $this->assertEquals($getOneArray, array('count' => 1, 'offset' => 0));
 }