public function testGet() { $products = organizeArray(mockSendToAPI(1), 'product'); $products = $products['product']; $this->assertEqual(6, sizeof($products)); $this->assertTrue(is_array($products[16133622])); $this->assertEqual('Face Persistent 24 hour artificial intelligence', $products[16133622]['title']); $this->assertEqual(40253192, $products[16133622]['variants']['variant']['id']); }
public function get($id = 0, $params = array(), $cache = false) { if ($id == 0) { if (!$cache || !isset($this->array['webhook'])) { $this->array = organizeArray(sendToAPI($this->prefix . "webhooks?" . $params), 'webhook'); } return $this->array['webhook']; } else { if (!$cache || !isset($this->array['webhook'][$id])) { $temp = sendToAPI($this->prefix . "webhooks/" . $id); $this->array['webhook'][$id] = $temp; } return $this->array['webhook'][$id]; } }