diff options
Diffstat (limited to 'AntiSpoof/tests/AntiSpoofTest.php')
-rw-r--r-- | AntiSpoof/tests/AntiSpoofTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/AntiSpoof/tests/AntiSpoofTest.php b/AntiSpoof/tests/AntiSpoofTest.php new file mode 100644 index 00000000..f369594d --- /dev/null +++ b/AntiSpoof/tests/AntiSpoofTest.php @@ -0,0 +1,30 @@ +<?php +class AntiSpoofTest extends MediaWikiTestCase { + + public function providePositives() { + return array( + /** Format: username -> spoofing attempt */ + array( 'Laura Fiorucci', 'Låura Fiorucci' ), + array( 'Lucien leGrey', 'Lucien le6rey' ), + array( 'Poco a poco', 'Poco a ƿoco' ), + array( 'Sabbut', 'ЅаЬЬцт'), + array( 'BetoCG', 'ВетоС6' ) + ); + } + + /** + * Some very basic normalization checks + * + * @covers AntiSpoof::checkUnicodeString + * @dataProvider providePositives + */ + public function testCheckUnicodeString( $userName, $spooferName ) { + $a = AntiSpoof::checkUnicodeString( $userName ); + $b = AntiSpoof::checkUnicodeString( $spooferName ); + + $this->assertEquals( 'OK', $a[0] ); + $this->assertEquals( 'OK', $b[0] ); + + $this->assertEquals( $a[1], $b[1] ); + } +} |