protected function setUp() { $cache = new ApcCache(); $cache->clear(); $search = json_decode(file_get_contents(__DIR__ . '/../fixtures/search.json')); $this->document = Document::parse($search[0]); $this->micro_api = Api::get(self::$testRepository, null, null, $cache); $this->linkResolver = new FakeLinkResolver(); }
protected function setUp() { $cache = new ApcCache(); $cache->clear(); $this->linkResolver = new FakeLinkResolver(); $this->id = 'Ue0EDd_mqb8Dhk3j'; $type = 'product'; $tags = array('macaron'); $slugs = array('ABCD'); $isBroken = false; $href = "http://myrepo.prismic.io/Ue0EDd_mqb8Dhk3j"; $this->document = new Document($this->id, null, $type, $href, $tags, $slugs, array()); $this->link = new DocumentLink($this->id, null, $type, $tags, $slugs[0], array(), $isBroken); $response = file_get_contents(__DIR__ . '/../fixtures/data.json'); $mock = new MockHandler([new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response), new Response(200, [], $response)]); $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->api = Api::get('dont care about this value', null, $client, $cache); }
protected function setUp() { $cache = new ApcCache(); $cache->clear(); $this->linkResolver = new FakeLinkResolver(); $this->id = 'Ue0EDd_mqb8Dhk3j'; $type = 'product'; $tags = array('macaron'); $slugs = array('ABCD'); $isBroken = false; $href = "http://myrepo.prismic.io/Ue0EDd_mqb8Dhk3j"; $this->document = new Document($this->id, null, $type, $href, $tags, $slugs, array()); $this->link = new DocumentLink($this->id, null, $type, $tags, $slugs[0], array(), $isBroken); $response = $this->getMockBuilder('Ivory\\HttpAdapter\\Message\\Response')->disableOriginalConstructor()->getMock(); $response->expects($this->once())->method('getBody')->will($this->returnValue(file_get_contents(__DIR__ . '/../fixtures/data.json'))); $httpAdapter = $this->getMock('Ivory\\HttpAdapter\\HttpAdapterInterface'); $httpAdapter->expects($this->any())->method('get')->will($this->returnValue($response)); $this->api = Api::get('don\'t care about this value', null, $httpAdapter, $cache); }
protected function setUp() { $cache = new ApcCache(); $cache->clear(); }