/** * @depends testConstructor * @param Config $config */ public function testSetCrypt(Config $config) { $config->setCryptType(3); $this->assertEquals(3, $config->getCryptType()); $config->setCryptType(19); // Invalid value $this->assertEquals(3, $config->getCryptType()); }
/** * @return \SimpleXMLElement */ public function getXml() { $request_type = in_array($this->type, array('txn', 'acs')) ? 'MpiRequest' : 'request'; $xml = new \SimpleXMLElement("<{$request_type}/>"); $xml->addChild('store_id', $this->config->getStoreId()); $xml->addChild('api_token', $this->config->getApiKey()); $type = $xml->addChild($this->type); foreach ($this->params as $key => $value) { $type->addChild($key, $value); } $type->addChild('crypt_type', $this->config->getCryptType()); return $xml; }
private function getTestConfig() { $config = new Config('test_api_key', 'store1'); $config->setEnvironment(Config::ENV_TESTING); return $config; }
private function getStagingConfig() { $config = new Config('test_api_key', 'store2'); $config->setEnvironment(Config::ENV_STAGING); return $config; }
protected function getConfig() { $config = new Config('yesguy', 'store1'); $config->setEnvironment(Config::ENV_TESTING); return $config; }