Skip to content

Commit

Permalink
Merge e931a3a into f043e1b
Browse files Browse the repository at this point in the history
  • Loading branch information
sopankhosla committed Aug 15, 2016
2 parents f043e1b + e931a3a commit 4967dc8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Tests/unitTest.php
Expand Up @@ -95,6 +95,38 @@ public function testUser() {
$this->assertArrayHasKey('screen_name', $userResponse['user']);
}

public function testSettings() {
$result = $this->loklak->settings();
$settingsResponse = json_decode($result, true);
if(getenv('TRAVIS') == true)
$this->assertEquals($settingsResponse[0], "This API has access restrictions: only localhost clients are granted.");
else
$this->assertEquals('200', $settingsResponse['status_code']);
}

public function testAccount() {
// Test for screen_name
$result = $this->loklak->account("test");
$accountSettings = json_decode($result, true);
if(getenv('TRAVIS') == true)
$this->assertEquals($accountSettings[0], "This API has access restrictions: only localhost clients are granted.");
else
$this->assertEquals('200', $settingsResponse['status_code']);

//Test for updating account info
$data = '{
"screen_name":"test",
"oauth_token":"abc",
"oauth_token_secret":"def"
}';
$result = $this->loklak->account(NULL, "update", json_decode($data));
$accountSettings = json_decode($result, true);
if(getenv('TRAVIS') == true)
$this->assertEquals($accountSettings[0], "This API has access restrictions: only localhost clients are granted.");
else
$this->assertEquals('200', $settingsResponse['status_code']);
}

public function testSearch() {
$result = $this->loklak->search('loklak', "2016-07-01", "2016-08-02", "KhoslaSopan", 10);
$searchResponse = json_decode($result);
Expand Down

0 comments on commit 4967dc8

Please sign in to comment.