-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#20 Added unit test to search and lookup influencers by email
- Loading branch information
KidA78
committed
Aug 27, 2014
1 parent
020ec8e
commit d868f42
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,6 +521,15 @@ public function testLookupRO() { | |
$this->assertNotEmpty($inf['aggregations']['countryIsoCode']['buckets'], 'No country aggregations found'); | ||
$this->assertGreaterThan(0, $inf['aggregations']['countryIsoCode']['buckets'][0]['count'], 'There should be more than zero matches for the first country'); | ||
|
||
// Lookup By Email | ||
$inf = Traackr\Influencers::search(array('keywords' => 'traackr', 'emails' => array('[email protected]', '[email protected]', '[email protected]'))); | ||
$this->assertGreaterThan(0, $inf['influencers'], 'No results found'); | ||
$this->assertEquals(2, count($inf['influencers']), 'Two results should have been found'); | ||
|
||
// Lookup By Email String | ||
$inf = Traackr\Influencers::search(array('keywords' => 'traackr', 'emails' => '[email protected],[email protected],[email protected]')); | ||
$this->assertGreaterThan(0, $inf['influencers'], 'No results found'); | ||
$this->assertEquals(2, count($inf['influencers']), 'Two results should have been found'); | ||
|
||
} // End function testLookup() | ||
|
||
|
@@ -594,6 +603,15 @@ public function testSearchRO() { | |
$inf = Traackr\Influencers::search(array('keywords' => 'xxxaaaxxx')); | ||
$this->assertCount(0, $inf['influencers'], 'Results found'); | ||
|
||
// Search Email | ||
$inf = Traackr\Influencers::search(array('keywords' => 'traackr', 'emails' => array('[email protected]'))); | ||
$this->assertGreaterThan(0, $inf['influencers'], 'No results found'); | ||
$this->assertEquals('David Chancogne', $inf['influencers'][0]['name'], 'Name does not match expected result by email address: [email protected]'); | ||
|
||
// Search Email (Emails param is string, not array) | ||
$inf = Traackr\Influencers::search(array('keywords' => 'traackr', 'emails' => '[email protected]')); | ||
$this->assertGreaterThan(0, $inf['influencers'], 'No results found'); | ||
$this->assertEquals('David Chancogne', $inf['influencers'][0]['name'], 'Name does not match expected result by email address: [email protected]'); | ||
} // End function testSearchRO() | ||
|
||
|
||
|