-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marco
committed
Jan 3, 2017
1 parent
4cab1c4
commit 49231d3
Showing
3 changed files
with
71 additions
and
4 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
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
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
class BreinRecommendationTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public static $API_KEY = "- HAS TO BE A VALID KEY -"; | ||
|
||
public static $API_KEY_WITH_SECRET = "- HAS TO BE A VALID KEY FOR SECRET -"; | ||
|
@@ -52,6 +51,46 @@ public function testRecommendationDataRequest() | |
echo "=========== END TEST ============="; | ||
} | ||
|
||
/** | ||
* Testcase of recommendation request with category | ||
*/ | ||
public function testRecommendationDataRequestWithCategory() | ||
{ | ||
echo "\n=========== START TEST =============\n"; | ||
echo "Running testRecommendationDataRequestWithCategory\n"; | ||
|
||
// configuration | ||
$breinify = new Breinify(BreinRecommendationTest::$API_KEY_WITH_SECRET, BreinRecommendationTest::$SECRET); | ||
|
||
// user | ||
$user = new BreinUser; | ||
$user->setEmail("[email protected]"); | ||
|
||
// recommendation | ||
$recommendation = new BreinRecommendation; | ||
$recommendation->setUser($user); | ||
$recommendation->setNumberOfRecommendations(2); | ||
$recommendation->setCategory("some category"); | ||
|
||
// invoke request | ||
$recResult = $breinify->recommendation($recommendation); | ||
|
||
// result | ||
if ($recResult->getStatus() == 200) { | ||
echo "\n Status from BreinRecommendationResult is: " . $recResult->getStatus(); | ||
echo "\n Message from BreinRecommendationResult is: " . $recResult->getMessage(); | ||
|
||
// loop over results | ||
foreach ($recResult->getResults() as $value) { | ||
echo "\n Result is: " . print_r($value, true); | ||
} | ||
|
||
} | ||
|
||
echo "\n"; | ||
echo "=========== END TEST ============="; | ||
} | ||
|
||
|
||
public function testRecommendationDataRequestComprehensive() | ||
{ | ||
|