GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 764334...261594 )
by Alexey
33:15
created

UserIdentityTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 10 1
A testCreatePassword() 0 9 1
A testUserPassword() 0 10 1
A testDevLogin() 0 6 1
A tearDown() 0 5 1
1
<?php
2
/**
3
 * @author Nikita Melnikov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2014 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 */
8
Yii::import('backend.components.auth.*');
9
Yii::import('backend.modules.rbac.models.User');
10
11
class UserIdentityTest extends CTestCase
12
{
13
  public function setUp()
14
  {
15
    parent::setUp();
16
17
    $user = new BUser();
18
    $user->id = 10;
19
    $user->username = 'admin';
20
    $user->passwordNew = '12345';
21
    $user->save(false);
22
  }
23
24
  public function testCreatePassword()
25
  {
26
    $salt = 'test';
27
28
    $username = 'test';
29
    $password = 'test';
30
31
    $this->assertEquals(md5($username.$password.$salt), BUserIdentity::createPassword($username, $password));
32
  }
33
34
  public function testUserPassword()
35
  {
36
    $user = new BUser();
37
    $user->id = 11;
38
    $user->username = 'test';
39
    $user->passwordNew = 'test';
40
    $user->save(false);
41
42
    $this->assertEquals(BUserIdentity::createPassword('test', 'test'), $user->password);
43
  }
44
45
  public function testDevLogin()
46
  {
47
    $identity = new BUserIdentity('admin', '12345');
48
    $this->assertEquals($identity->authenticate(), true);
49
    $this->assertEquals($identity->id, 10);
50
  }
51
52
  public function tearDown()
53
  {
54
    BUser::model()->deleteByPk(10);
55
    BUser::model()->deleteByPk(11);
56
  }
57
58
}