/** * Set the keyword and fire all the needed things * * @var $keyword */ function __construct(Query $q) { $this->keyword = $q->getKeyword(); $this->queryURL = $q->getQuery(); $this->jsonResponse = $this->getGoogleImageJSONData(); $this->setResultsDetail(); $this->reconstructData(); }
function testConstructor() { $qc = new QueryClass('pedang dan asu', 8, 'small'); $qc->setKeyword('pedang dan asu'); $this->assertEquals('https://ajax.googleapis.com/ajax/services/search/images?rsz=8&q=' . urlencode($qc->getKeyword()) . '&start=8&v=1.0&&imgsz=small', $qc->getQuery()); }