/** * Make a call to the product page to crawl the information * * @param $url * @param array $information * @return array */ protected function getProductInformation($url, $information = []) { $request = $this->httpClient->setUrl($url)->request(); $crawler = new Crawler($request['body']); $information['description'] = trim($crawler->filter('div.productText')->first()->text()); $information['size'] = $request['size']; return $information; }
/** * Test the setters and getters */ public function testClient() { $this->httpClient->setUrl(self::URL)->setClient($this->clientMock); $this->assertEquals($this->clientMock, $this->httpClient->getClient()); $this->assertEquals(self::URL, $this->httpClient->getUrl()); }