public function testCp1251() { $this->assertSame('******', ObsceneCensorRus::getFiltered('ѕи«дёк', 'CP1251')); $this->assertSame('*****', ObsceneCensorRus::getFiltered('сучка', 'CP1251')); $this->assertSame('DHIWE ******', ObsceneCensorRus::getFiltered('DHIWE E6AHOE', 'CP1251')); $this->assertSame('********', ObsceneCensorRus::getFiltered('ибанушка', 'CP1251')); $this->assertTrue(ObsceneCensorRus::isAllowed('обычный текст', 'CP1251')); }
public function testAllowed() { $this->assertTrue(ObsceneCensorRus::isAllowed('Ан нет. Готовит снова рок Последний жесткий свой урок.')); $this->assertFalse(ObsceneCensorRus::isAllowed('Итак, пиздец приходит дяде. Навек прощайте, водка, бляди…')); }
public function testFalsePositive() { $this->assertSame('феерический *******', ObsceneCensorRus::getFiltered('феерический долбоеб')); $this->assertSame('12 ноября', ObsceneCensorRus::getFiltered('12 ноября')); $this->assertTrue(ObsceneCensorRus::isAllowed('dying')); }