diff --git a/misc/testing/Tests/test_amazon_API.php b/misc/testing/Tests/test_amazon_API.php index 7ca5ee19e..a6c560365 100644 --- a/misc/testing/Tests/test_amazon_API.php +++ b/misc/testing/Tests/test_amazon_API.php @@ -4,7 +4,6 @@ require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . use ApaiIO\ApaiIO; use ApaiIO\Configuration\GenericConfiguration; use ApaiIO\Operations\Search; -use ApaiIO\ResponseTransformer\XmlToSimpleXmlObject; use app\models\Settings; @@ -13,12 +12,16 @@ $privkey = Settings::value('APIs..amazonprivkey'); $asstag = Settings::value('APIs..amazonassociatetag'); $conf = new GenericConfiguration(); +$client = new \GuzzleHttp\Client(); +$request = new \ApaiIO\Request\GuzzleRequest($client); + $conf ->setCountry('com') ->setAccessKey($pubkey) ->setSecretKey($privkey) ->setAssociateTag($asstag) - ->setResponseTransformer(XmlToSimpleXmlObject::class); + ->setRequest($request) + ->setResponseTransformer(new \ApaiIO\ResponseTransformer\XmlToSimpleXmlObject()); $search = new Search(); $search->setCategory('VideoGames'); diff --git a/nntmux/Books.php b/nntmux/Books.php index 37a5f830c..6ed439b67 100755 --- a/nntmux/Books.php +++ b/nntmux/Books.php @@ -1,8 +1,10 @@ setCountry('com') ->setAccessKey($this->pubkey) ->setSecretKey($this->privkey) ->setAssociateTag($this->asstag) - ->setResponseTransformer(XmlToSimpleXmlObject::class); + ->setRequest($request) + ->setResponseTransformer(new XmlToSimpleXmlObject()); } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/nntmux/Console.php b/nntmux/Console.php index 6e6c835ef..bbd681b84 100755 --- a/nntmux/Console.php +++ b/nntmux/Console.php @@ -1,8 +1,10 @@ setCountry('com') ->setAccessKey($this->pubkey) ->setSecretKey($this->privkey) ->setAssociateTag($this->asstag) - ->setResponseTransformer(XmlToSimpleXmlObject::class); + ->setRequest($request) + ->setResponseTransformer(new XmlToSimpleXmlObject()); } catch (\Exception $e) { echo $e->getMessage(); }