Skip to content

Commit 831dcfc

Browse files
committed
Adding the Mwop-Test to the testsuite
1 parent 5f98f18 commit 831dcfc

File tree

2 files changed

+36
-86
lines changed

2 files changed

+36
-86
lines changed

library/Zftest/Validate/PasswordStrength.php

Lines changed: 0 additions & 86 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
class Zftest_Validate_MwopTest extends PHPUnit_Framework_TestCase
3+
{
4+
public function fullnameProvider()
5+
{
6+
return array (
7+
array ("Matthew Weier O'Phinney"),
8+
array ("D. Keith Casey, Jr."),
9+
array ("Jean-Claude Van Damme"),
10+
array ("C3PIO"),
11+
);
12+
}
13+
public function badnameProvider()
14+
{
15+
return array (
16+
array ("1' OR 1=1; --"),
17+
array ("\''; DROP TABLE users; --"),
18+
);
19+
}
20+
/**
21+
* @dataProvider fullnameProvider
22+
*/
23+
public function testCorrectNamesPassMwopTest($fullname)
24+
{
25+
$mwop = new Prozf_Validate_Mwop();
26+
$this->assertTrue($mwop->isValid($fullname));
27+
}
28+
/**
29+
* @dataProvider badnameProvider
30+
*/
31+
public function testBadNamesDoNotPassMwopTest($badname)
32+
{
33+
$mwop = new Prozf_Validate_Mwop();
34+
$this->assertFalse($mwop->isValid($badname));
35+
}
36+
}

0 commit comments

Comments
 (0)