Beispiel #1
0
 /**
  * @dataProvider dataProvider_Search
  */
 public function testSearch_WithValidTerms_ReturnsExpectedResults($searchTerms, $numResults, $expectedKeys)
 {
     $audit = new Audit();
     $audit->setAttributes($searchTerms);
     $results = $audit->search();
     $data = $results->getData();
     $expectedResults = array();
     if (!empty($expectedKeys)) {
         foreach ($expectedKeys as $key) {
             $expectedResults[] = $this->audit($key);
         }
     }
     $this->assertEquals($numResults, $results->getItemCount());
     $this->assertEquals($expectedResults, array('0' => $data[0]));
 }