- public function testRunLogin() {
- $user = self::$users['sysop'];
- $userName = $user->getUser()->getName();
- $password = $user->getPassword();
-
- $data = $this->doApiRequest( [
- 'action' => 'login',
- 'lgname' => $userName,
- 'lgpassword' => $password ] );
-
- $this->assertArrayHasKey( "login", $data[0] );
- $this->assertArrayHasKey( "result", $data[0]['login'] );
- $this->assertEquals( "NeedToken", $data[0]['login']['result'] );
- $token = $data[0]['login']['token'];
-
- $data = $this->doApiRequest( [
- 'action' => 'login',
- "lgtoken" => $token,
- "lgname" => $userName,
- "lgpassword" => $password ], $data[2] );
-
- $this->assertArrayHasKey( "login", $data[0] );
- $this->assertArrayHasKey( "result", $data[0]['login'] );
- $this->assertEquals( "Success", $data[0]['login']['result'] );
- }
-