Esempio n. 1
0
 /**
  * @covers ::execute
  *
  * @dataProvider providerTestExecuteRealRequest
  *
  * @depends      testExecute
  */
 public function testExecuteRealRequest($type, $form, $instanceof)
 {
     $this->sut = Search::create($this->productionRequestHandler);
     $languageCodes = ['en'];
     $query = '';
     $limit = mt_rand(1, 9);
     $mtgObjects = $this->sut->setLanguageCodes($languageCodes)->setForm($form)->setQuery($query)->setLimit($limit)->setTypes([$type])->execute();
     $this->assertInternalType('array', $mtgObjects);
     // If the request does not return any data, we cannot test its
     // integrity.
     $this->assertNotEmpty($mtgObjects);
     $this->assertTrue(count($mtgObjects) <= $limit);
     foreach ($mtgObjects as $mtgObject) {
         $this->assertInstanceOf($instanceof, $mtgObject);
     }
 }
Esempio n. 2
0
 public function search(array $languageCodes, $query)
 {
     return Search::create($this->requestHandler)->setLanguageCodes($languageCodes)->setQuery($query);
 }