/** * @depends testGetProduct */ public function testGetMxxPrice(Product $product) { $this->assertNotNull($product->getMinPrice()); $this->assertInternalType('int', $product->getMinPrice()); $this->assertNotNull($product->getMaxPrice()); $this->assertInternalType('int', $product->getMaxPrice()); }
/** * @expectedException \AboutYou\SDK\Exception\RuntimeException */ public function testGetBrandRuntimeException() { $json = json_decode('{"id":1,"name":"Product"}'); $product = Product::createFromJson($json, $this->getModelFactory(), 1); $product->getBrand(); }
/** * {@inheritdoc} * * @return Model\Product */ public function createProduct(stdClass $jsonObject) { return Model\Product::createFromJson($jsonObject, $this, $this->ay->getAppId()); }
public function getProduct($filename) { $json = $this->getJsonObjectFromFile('product/' . $filename); $product = Product::createFromJson($json, $this->ay->getResultFactory(), 98); return $product; }
private function getProduct() { $json = json_decode('{"id":1,"name":"Product"}'); return Product::createFromJson($json, $this->getModelFactory(), 1); }