Skip to content

Commit

Permalink
Added dotenv for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayk committed Apr 27, 2016
1 parent 6455bdf commit 3ff70d2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
vendor
vendor
.env
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"php": ">=5.4.0",
"guzzlehttp/guzzle": "^6.2",
"illuminate/support": "4.*|5.*",
"symfony/psr-http-message-bridge": "^0.2.0"
"symfony/psr-http-message-bridge": "^0.2.0",
"vlucas/phpdotenv": "^2.2"
},
"autoload": {
"psr-4": {
Expand Down
58 changes: 53 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/OneSignalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($appId, $restApiKey, $userAuthKey)
}

public function testCredentials() {
return "APP ID".$this->appId." REST: ".$this->restApiKey;
return "APP ID: ".$this->appId." REST: ".$this->restApiKey;
}

public function sendNotification($parameters = []){
Expand Down
8 changes: 7 additions & 1 deletion tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

require_once __DIR__ . '/../vendor/autoload.php';

$client = new Berkayk\OneSignal\OneSignalClient("1","2","3");
$dotenv = new Dotenv\Dotenv(__DIR__."/../");
$dotenv->load();

$client = new Berkayk\OneSignal\OneSignalClient(
getenv('APP_ID'),
getenv('REST_API_KEY'),
getenv('USER_AUTH_KEY'));

echo $client->testCredentials();

0 comments on commit 3ff70d2

Please sign in to comment.