File tree 4 files changed +31
-9
lines changed
4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,15 @@ dist: trusty
3
3
php :
4
4
- ' 7.1.18'
5
5
- ' 7.2'
6
+ - nightly
6
7
- ' hhvm'
8
+ matrix :
9
+ allow_failures :
10
+ - php : nightly
7
11
install :
8
- - composer update
12
+ - composer install
9
13
script :
10
14
- ./vendor/bin/phpunit --coverage-clover ./tests/Logs/clover.xml
11
15
- ./vendor/bin/psalm
12
16
after_script :
13
- - php vendor/bin/php-coveralls -v
17
+ - php vendor/bin/php-coveralls -v
Original file line number Diff line number Diff line change 9
9
}
10
10
],
11
11
"require-dev" : {
12
- "phpunit/phpunit" : " ^5.7 " ,
12
+ "phpunit/phpunit" : " ^6.5 " ,
13
13
"fzaninotto/faker" : " ^1.7" ,
14
14
"vimeo/psalm" : " ^1" ,
15
15
"php-coveralls/php-coveralls" : " ^2.1"
22
22
" src/PasswordExposedFunction.php"
23
23
]
24
24
},
25
+ "autoload-dev" : {
26
+ "psr-4" : {
27
+ "DivineOmega\\ PasswordExposed\\ Tests\\ " : " tests/"
28
+ }
29
+ },
25
30
"license" : " LGPL-3.0-only" ,
26
31
"require" : {
27
32
"php" : " >=5.6" ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ namespace DivineOmega \PasswordExposed \Tests ;
4
+
3
5
use DivineOmega \PasswordExposed \PasswordExposedChecker ;
4
6
use DivineOmega \PasswordExposed \PasswordStatus ;
5
7
use ParagonIE \Certainty \Bundle ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ namespace DivineOmega \PasswordExposed \Tests ;
4
+
3
5
use DivineOmega \PasswordExposed \PasswordStatus ;
6
+ use Faker \Factory ;
4
7
use PHPUnit \Framework \TestCase ;
5
8
6
9
class PasswordExposedTest extends TestCase
@@ -10,13 +13,21 @@ public function testFunctionExists()
10
13
$ this ->assertTrue (function_exists ('password_exposed ' ));
11
14
}
12
15
13
- public function testExposedPasswords ()
16
+ public function exposedPasswordsProvider ()
14
17
{
15
- $ passwords = ['test ' , 'password ' , 'hunter2 ' ];
18
+ return [
19
+ ['test ' ],
20
+ ['password ' ],
21
+ ['hunter2 ' ],
22
+ ];
23
+ }
16
24
17
- foreach ($ passwords as $ password ) {
18
- $ this ->assertEquals (password_exposed ($ password ), PasswordStatus::EXPOSED );
19
- }
25
+ /**
26
+ * @dataProvider exposedPasswordsProvider
27
+ */
28
+ public function testExposedPasswords ($ password )
29
+ {
30
+ $ this ->assertEquals (password_exposed ($ password ), PasswordStatus::EXPOSED );
20
31
}
21
32
22
33
public function testNotExposedPasswords ()
@@ -26,7 +37,7 @@ public function testNotExposedPasswords()
26
37
27
38
private function getPasswordUnlikelyToBeExposed ()
28
39
{
29
- $ faker = Faker \ Factory::create ();
40
+ $ faker = Factory::create ();
30
41
31
42
$ password = '' ;
32
43
You can’t perform that action at this time.
0 commit comments