Completed
Push — master ( ae56ac...8b2545 )
by Stefano
02:26
created

PasswordTest::testMakeAndVerify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
class PasswordTest extends PHPUnit_Framework_TestCase {
4
5
  public function testMakeAndVerify(){
6
    $the_password = "MyLittleSecret";
7
8
    $hash   = Password::make($the_password);
9
    $hash_2 = Password::make("Fake!");
10
11
    $this->assertNotEmpty($hash);
12
    $this->assertNotEmpty($hash_2);
13
14
    $this->assertTrue(Password::verify($the_password,$hash));
15
    $this->assertFalse(Password::verify($the_password,$hash_2));
16
17
    $this->assertTrue(Password::compare($the_password,$the_password));
18
    $this->assertFalse(Password::compare($the_password,"not-the-same"));
19
20
  }
21
22
}
23
24