public function testTypesAvailable() { $o = new Mtgim_Api_Client('testKey', 'testSecret'); $this->assertEquals(array('A' => 'Vše', 'F' => 'Foilové', 'R' => 'Obyčejné'), $o->typesAvailable()); }
*/ // ========== SETTINGS ========= // these settings are testing ones - you will get only fake results // you can change them to your production settings // if you do not have production setting, contact us $apiKey = 'testKey'; $secret = 'testSecret'; // ========== MAGIC ========= // include library require_once __DIR__ . '/mtgim-api-lib/Client.php'; // instantiate library $mtgim = new Mtgim_Api_Client($apiKey, $secret); // get list of available shops $shops = $mtgim->shopsAvailable(); // get list of available card types $cardTypes = $mtgim->typesAvailable(); // local variables $showResults = FALSE; $message = NULL; $cardname = ''; $selectedShop = ''; $selectedType = ''; // if form was sent, try to find card results if (isset($_POST['cardname']) && !empty($_POST['cardname'])) { $cardname = $_POST['cardname']; $selectedShop = $_POST['shop']; $selectedType = $_POST['foil']; // make sure values are valid if (!array_key_exists($selectedShop, $shops) || !array_key_exists($selectedType, $cardTypes)) { $message = 'Neplatné parametry!'; } else {