Add API testing scripts

This commit is contained in:
DariusIII
2015-12-15 14:30:16 +01:00
parent d873f8395d
commit d4a7a31576
7 changed files with 125 additions and 5 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use libs\ApaiIO\Configuration\GenericConfiguration;
use libs\ApaiIO\Operations\Search;
use libs\ApaiIO\ApaiIO;
use newznab\db\Settings;
$s = new Settings();
$pubkey = $s->getSetting('amazonpubkey');
$privkey = $s->getSetting('amazonprivkey');
$asstag = $s->getSetting('amazonassociatetag');
$conf = new GenericConfiguration();
$conf
->setCountry('com')
->setAccessKey($pubkey)
->setSecretKey($privkey)
->setAssociateTag($asstag)
->setResponseTransformer('\libs\ApaiIO\ResponseTransformer\XmlToSimpleXmlObject');
$search = new Search();
$search->setCategory('VideoGames');
$search->setKeywords('Guilty Gear 2 Oveture');
$search->setResponseGroup(['Large']);
$search->setPage(1);
$apaiIo = new ApaiIO($conf);
$response = $apaiIo->runOperation($search);
var_dump($response);