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::testCreatePassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
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
}