File tree Expand file tree Collapse file tree 2 files changed +36
-86
lines changed
tests/library/Zftest/Validate Expand file tree Collapse file tree 2 files changed +36
-86
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments