Example #1
0
 public function testCanSearchForPagesOfSentimentForTerm()
 {
     // setup
     $searchTerm = 'Microsoft';
     // do the test
     $client = new Client($this->_apiKey);
     $results1 = $client->callSearchForSentimentAbout($searchTerm, null);
     $results2 = $client->callSearchForSentimentAbout($searchTerm, null, 2);
     // evaluate the results
     //
     // we can make sure that the results are internally
     // consistent
     $this->assertTrue(isset($results1['number_of_results']));
     $this->assertTrue(isset($results1['results']));
     $this->assertEquals($results1['number_of_results'], count($results1['results']));
     $this->assertTrue(isset($results2['number_of_results']));
     $this->assertTrue(isset($results2['results']));
     $this->assertEquals($results2['number_of_results'], count($results2['results']));
     $this->assertNotSame($results1, $results2);
 }