/** * Test the Parameterize function of the model * @test * @depends setGetTest */ public function parameterizeTest(Request\Checksum $model) { $parameterArray = array(); $parameterArray['checksum_type'] = 'postfinance_card'; $parameterArray['amount'] = '200'; $parameterArray['currency'] = 'CHF'; $parameterArray['description'] = 'foo bar'; $creationArray = $model->parameterize("getOne"); $this->assertEquals($creationArray, $parameterArray); }
/** * Test the Parameterize function of the model * * @param Checksum $model * * @test * @depends setGetTest */ public function parameterizeTestCreate(Checksum $model) { $parameterArray = array(); $parameterArray['checksum_type'] = Checksum::TYPE_PAYPAL; $parameterArray['amount'] = '200'; $parameterArray['currency'] = 'EUR'; $parameterArray['description'] = 'foo bar'; $parameterArray['return_url'] = 'https://www.example.com'; $parameterArray['cancel_url'] = 'https://www.example.com'; $parameterArray['shipping_address'] = array('name' => 'Noch ein test', 'street_address' => 'Unit street', 'street_address_additional' => 'uff', 'city' => 'Test city', 'postal_code' => 'BLABLA', 'state' => 'BAVARIA', 'country' => 'DE', 'phone' => '0892353453'); $parameterArray['billing_address'] = array('name' => 'Noch ein test', 'street_address' => 'Unit street', 'street_address_additional' => 'uff', 'city' => 'Test city', 'postal_code' => 'BLABLA', 'state' => 'BAVARIA', 'country' => 'DE', 'phone' => '0892353453'); $parameterArray['items'] = array(array('name' => 'Foo', 'description' => 'Bar', 'item_number' => 'PROD1', 'url' => 'http://www.foo.de', 'amount' => '200', 'quantity' => 1), array('name' => 'Foo', 'description' => 'bock auf testing', 'item_number' => 'PROD2', 'url' => 'http://www.bar.de', 'amount' => '200', 'quantity' => 1)); $parameterArray['shipping_amount'] = '50'; $parameterArray['handling_amount'] = '50'; $creationArray = $model->parameterize("create"); $this->assertEquals($creationArray, $parameterArray); }