-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
30 changed files
with
476 additions
and
155 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
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 |
---|---|---|
|
@@ -248,9 +248,11 @@ public function testAddUserWrongEmail() | |
public function testAddUserLongPassword() | ||
{ | ||
$login = "geggeqgeqag"; | ||
$this->api->addUser($login, | ||
"geqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaeg", | ||
"[email protected]"); | ||
$this->api->addUser( | ||
$login, | ||
"geqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaegeqgeagaeg", | ||
"[email protected]" | ||
); | ||
$user = $this->api->getUser($login); | ||
$this->assertEquals($login, $user['login']); | ||
} | ||
|
@@ -269,8 +271,10 @@ public function testAddUser() | |
$user = $this->model->getUser($login); | ||
|
||
// check that the date registered is correct | ||
$this->assertTrue($time <= strtotime($user['date_registered']) && strtotime($user['date_registered']) <= time(), | ||
"the date_registered " . strtotime($user['date_registered']) . " is different from the time() " . time()); | ||
$this->assertTrue( | ||
$time <= strtotime($user['date_registered']) && strtotime($user['date_registered']) <= time(), | ||
"the date_registered " . strtotime($user['date_registered']) . " is different from the time() " . time() | ||
); | ||
|
||
// check that password and token are properly set | ||
$this->assertEquals(60, strlen($user['password'])); | ||
|
@@ -487,10 +491,14 @@ public function testGetUsers() | |
); | ||
$expectedUsers = array($user1, $user2, $user3); | ||
$this->assertEquals($expectedUsers, $users); | ||
$this->assertEquals(array($user1), | ||
$this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag'))); | ||
$this->assertEquals(array($user1, $user2), | ||
$this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag,geggeqge632ge56a4qag'))); | ||
$this->assertEquals( | ||
array($user1), | ||
$this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag')) | ||
); | ||
$this->assertEquals( | ||
array($user1, $user2), | ||
$this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag,geggeqge632ge56a4qag')) | ||
); | ||
} | ||
|
||
public function testGetUsers_withViewAccess_shouldThrowAnException() | ||
|
@@ -1168,8 +1176,10 @@ private function addSites($numberOfSites) | |
|
||
for ($index = 0; $index < $numberOfSites; $index++) { | ||
$name = "test" . ($index + 1); | ||
$idSites[] = APISitesManager::getInstance()->addSite($name, | ||
array("http://piwik.net", "http://piwik.com/test/")); | ||
$idSites[] = APISitesManager::getInstance()->addSite( | ||
$name, | ||
array("http://piwik.net", "http://piwik.com/test/") | ||
); | ||
} | ||
|
||
return $idSites; | ||
|
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
Oops, something went wrong.