Merge branch 'master' of github.com:arandilopez/laravel-profane
This commit is contained in:
commit
d18fb71e60
|
|
@ -7,16 +7,18 @@ use Illuminate\Support\Facades\Config;
|
|||
class Dictionary
|
||||
{
|
||||
/**
|
||||
* [$dictionary description]
|
||||
* [$dictionary description].
|
||||
*
|
||||
* @var [type]
|
||||
*/
|
||||
private $dictionary;
|
||||
|
||||
/**
|
||||
* [__construct description]
|
||||
* [__construct description].
|
||||
*
|
||||
* @param [type] $dictionary [description]
|
||||
*/
|
||||
function __construct($dictionary = null)
|
||||
public function __construct($dictionary = null)
|
||||
{
|
||||
// Get default locale string in laravel project
|
||||
// and set it as default dictionary
|
||||
|
|
@ -26,7 +28,8 @@ class Dictionary
|
|||
}
|
||||
|
||||
/**
|
||||
* [getDictionary description]
|
||||
* [getDictionary description].
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function getDictionary()
|
||||
|
|
@ -35,7 +38,8 @@ class Dictionary
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the dictionary to use
|
||||
* Set the dictionary to use.
|
||||
*
|
||||
* @param array|string $dictionary
|
||||
*/
|
||||
public function setDictionary($dictionary)
|
||||
|
|
@ -44,8 +48,10 @@ class Dictionary
|
|||
}
|
||||
|
||||
/**
|
||||
* [readDictionary description]
|
||||
* [readDictionary description].
|
||||
*
|
||||
* @param [type] $dictionary [description]
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
protected function readDictionary($dictionary)
|
||||
|
|
@ -55,23 +61,23 @@ class Dictionary
|
|||
if (is_array($dictionary)) {
|
||||
foreach ($dictionary as $file) {
|
||||
if (file_exists($baseDictPath.$file.'.php')) {
|
||||
$dict = include($baseDictPath.$file.'.php');
|
||||
$dict = include $baseDictPath.$file.'.php';
|
||||
$words = array_merge($words, $dict);
|
||||
} else {
|
||||
// if the file isn't in the dict directory,
|
||||
// it's probably a custom user library
|
||||
$dict = include($file);
|
||||
$dict = include $file;
|
||||
$words = array_merge($words, $dict);
|
||||
}
|
||||
}
|
||||
// just a single string, not an array
|
||||
} elseif (is_string($dictionary)) {
|
||||
if (file_exists($baseDictPath.$dictionary.'.php')) {
|
||||
$dict = include($baseDictPath.$dictionary.'.php');
|
||||
$dict = include $baseDictPath.$dictionary.'.php';
|
||||
$words = array_merge($words, $dict);
|
||||
} else {
|
||||
if (file_exists($dictionary)) {
|
||||
$dict = include($dictionary);
|
||||
$dict = include $dictionary;
|
||||
$words = array_merge($words, $dict);
|
||||
} // else nothing is merged
|
||||
}
|
||||
|
|
@ -81,7 +87,8 @@ class Dictionary
|
|||
}
|
||||
|
||||
/**
|
||||
* [getBaseDictPath description]
|
||||
* [getBaseDictPath description].
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
protected function getBaseDictPath()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace LaravelProfane;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ProfaneServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,39 +2,43 @@
|
|||
|
||||
namespace LaravelProfane;
|
||||
|
||||
use LaravelProfane\Dictionary;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
|
||||
class ProfaneValidator
|
||||
{
|
||||
/**
|
||||
* [$dictionary description]
|
||||
* [$dictionary description].
|
||||
*
|
||||
* @var [type]
|
||||
*/
|
||||
protected $dictionary;
|
||||
|
||||
/**
|
||||
* [$badwords description]
|
||||
* [$badwords description].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $badwords = [];
|
||||
|
||||
/**
|
||||
* [__construct description]
|
||||
* [__construct description].
|
||||
*
|
||||
* @param Dictionary $dictionary [description]
|
||||
*/
|
||||
function __construct(Dictionary $dictionary)
|
||||
public function __construct(Dictionary $dictionary)
|
||||
{
|
||||
$this->dictionary = $dictionary;
|
||||
$this->badwords = $dictionary->getDictionary();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to extends to Validator
|
||||
* Method to extends to Validator.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param midex $value
|
||||
* @param array $parameters
|
||||
* @param \Illuminate\Contracts\Validation\Validator $validator [description]
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validate($attribute, $value, $parameters)
|
||||
|
|
@ -48,8 +52,10 @@ class ProfaneValidator
|
|||
}
|
||||
|
||||
/**
|
||||
* Check profanity of text
|
||||
* Check profanity of text.
|
||||
*
|
||||
* @param string $text
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isProfane($text)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class Str
|
|||
*
|
||||
* @param string $haystack
|
||||
* @param string|array $needles
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function containsCaseless($haystack, $needles)
|
||||
|
|
@ -20,12 +21,15 @@ class Str
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove accents or special characters from a string.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function removeAccent($string)
|
||||
|
|
|
|||
|
|
@ -77,5 +77,5 @@ return [
|
|||
'taint',
|
||||
'titty',
|
||||
'vag',
|
||||
'whore'
|
||||
'whore',
|
||||
];
|
||||
|
|
|
|||
390
src/dict/it.php
390
src/dict/it.php
|
|
@ -10,200 +10,200 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
"affanculo",
|
||||
"allupato",
|
||||
"ammucchiata",
|
||||
"anale",
|
||||
"arrapato",
|
||||
"arrusa",
|
||||
"arruso",
|
||||
"assatanato",
|
||||
"bagascia",
|
||||
"bagassa",
|
||||
"bagnarsi",
|
||||
"baldracca",
|
||||
"balle",
|
||||
"battere",
|
||||
"battona",
|
||||
"belino",
|
||||
"biga",
|
||||
"bocchinara",
|
||||
"bocchinaro",
|
||||
"bocchino",
|
||||
"bofilo",
|
||||
"boiata",
|
||||
"bordello",
|
||||
"brinca",
|
||||
"bucaiolo",
|
||||
"budiùlo",
|
||||
"buona donna",
|
||||
"busone",
|
||||
"cacca",
|
||||
"caccati in mano e prenditi a schiaffi",
|
||||
"caciocappella",
|
||||
"cadavere",
|
||||
"cagare",
|
||||
"cagata",
|
||||
"cagna",
|
||||
"cammello",
|
||||
"cappella",
|
||||
"carciofo",
|
||||
"carità",
|
||||
"casci",
|
||||
"cazzata",
|
||||
"cazzi",
|
||||
"cazzimma",
|
||||
"cazzo",
|
||||
"checca",
|
||||
"chiappa",
|
||||
"chiavare",
|
||||
"chiavata",
|
||||
"ciospo",
|
||||
"ciucciami il cazzo",
|
||||
"coglione",
|
||||
"coglioni",
|
||||
"cornuto",
|
||||
"cozza",
|
||||
"culattina",
|
||||
"culattone",
|
||||
"culo",
|
||||
"di merda",
|
||||
"dio bestia",
|
||||
"dio cane",
|
||||
"dio porco",
|
||||
"ditalino",
|
||||
"duro",
|
||||
"fanculo",
|
||||
"fare unaŠ",
|
||||
"fava",
|
||||
"femminuccia",
|
||||
"fica",
|
||||
"figa",
|
||||
"figlio di buona donna",
|
||||
"figlio di puttana",
|
||||
"figone",
|
||||
"finocchio",
|
||||
"fottere",
|
||||
"fottersi",
|
||||
"fracicone",
|
||||
"fregna",
|
||||
"frocio",
|
||||
"froscio",
|
||||
"fuori come un balcone",
|
||||
"goldone",
|
||||
"grilletto",
|
||||
"guanto",
|
||||
"guardone",
|
||||
"incazzarsi",
|
||||
"incoglionirsi",
|
||||
"inculare",
|
||||
"ingoio",
|
||||
'affanculo',
|
||||
'allupato',
|
||||
'ammucchiata',
|
||||
'anale',
|
||||
'arrapato',
|
||||
'arrusa',
|
||||
'arruso',
|
||||
'assatanato',
|
||||
'bagascia',
|
||||
'bagassa',
|
||||
'bagnarsi',
|
||||
'baldracca',
|
||||
'balle',
|
||||
'battere',
|
||||
'battona',
|
||||
'belino',
|
||||
'biga',
|
||||
'bocchinara',
|
||||
'bocchinaro',
|
||||
'bocchino',
|
||||
'bofilo',
|
||||
'boiata',
|
||||
'bordello',
|
||||
'brinca',
|
||||
'bucaiolo',
|
||||
'budiùlo',
|
||||
'buona donna',
|
||||
'busone',
|
||||
'cacca',
|
||||
'caccati in mano e prenditi a schiaffi',
|
||||
'caciocappella',
|
||||
'cadavere',
|
||||
'cagare',
|
||||
'cagata',
|
||||
'cagna',
|
||||
'cammello',
|
||||
'cappella',
|
||||
'carciofo',
|
||||
'carità',
|
||||
'casci',
|
||||
'cazzata',
|
||||
'cazzi',
|
||||
'cazzimma',
|
||||
'cazzo',
|
||||
'checca',
|
||||
'chiappa',
|
||||
'chiavare',
|
||||
'chiavata',
|
||||
'ciospo',
|
||||
'ciucciami il cazzo',
|
||||
'coglione',
|
||||
'coglioni',
|
||||
'cornuto',
|
||||
'cozza',
|
||||
'culattina',
|
||||
'culattone',
|
||||
'culo',
|
||||
'di merda',
|
||||
'dio bestia',
|
||||
'dio cane',
|
||||
'dio porco',
|
||||
'ditalino',
|
||||
'duro',
|
||||
'fanculo',
|
||||
'fare unaŠ',
|
||||
'fava',
|
||||
'femminuccia',
|
||||
'fica',
|
||||
'figa',
|
||||
'figlio di buona donna',
|
||||
'figlio di puttana',
|
||||
'figone',
|
||||
'finocchio',
|
||||
'fottere',
|
||||
'fottersi',
|
||||
'fracicone',
|
||||
'fregna',
|
||||
'frocio',
|
||||
'froscio',
|
||||
'fuori come un balcone',
|
||||
'goldone',
|
||||
'grilletto',
|
||||
'guanto',
|
||||
'guardone',
|
||||
'incazzarsi',
|
||||
'incoglionirsi',
|
||||
'inculare',
|
||||
'ingoio',
|
||||
"l'arte bolognese",
|
||||
"leccaculo",
|
||||
"lecchino",
|
||||
"lofare",
|
||||
"loffa",
|
||||
"loffare",
|
||||
"lumaca",
|
||||
"manico",
|
||||
"mannaggia",
|
||||
"merda",
|
||||
"merdata",
|
||||
"merdoso",
|
||||
"mignotta",
|
||||
"minchia",
|
||||
"minchione",
|
||||
"mona",
|
||||
"monta",
|
||||
"montare",
|
||||
"mussa",
|
||||
"nave scuola",
|
||||
"nerchia",
|
||||
"nudo",
|
||||
"padulo",
|
||||
"palle",
|
||||
"palloso",
|
||||
"patacca",
|
||||
"patonza",
|
||||
"pecorina",
|
||||
"pesce",
|
||||
"picio",
|
||||
"pincare",
|
||||
"pipa",
|
||||
"pippone",
|
||||
"pipì",
|
||||
"pirla",
|
||||
"pisciare",
|
||||
"piscio",
|
||||
"pisello",
|
||||
"pistola",
|
||||
"pistolotto",
|
||||
"pomiciare",
|
||||
"pompa",
|
||||
"pompinara",
|
||||
"pompino",
|
||||
"porca madonna",
|
||||
"porca miseria",
|
||||
"porca puttana",
|
||||
"porca",
|
||||
"porco dio",
|
||||
"porco due",
|
||||
"porco zio",
|
||||
"potta",
|
||||
"puppami",
|
||||
"puttana",
|
||||
"quaglia",
|
||||
"recchione",
|
||||
"regina",
|
||||
"ricchione",
|
||||
"rincoglionire",
|
||||
"rizzarsi",
|
||||
"rompiballe",
|
||||
"rottinculo",
|
||||
"ruffiano",
|
||||
"sbattere",
|
||||
"sbattersi",
|
||||
"sborra",
|
||||
"sborrata",
|
||||
"sborrone",
|
||||
"sbrodolata",
|
||||
"scopare",
|
||||
"scopata",
|
||||
"scorreggiare",
|
||||
"sega",
|
||||
"segaiolo",
|
||||
"slinguare",
|
||||
"slinguata",
|
||||
"smandrappata",
|
||||
"soccia",
|
||||
"socmel",
|
||||
"sorca",
|
||||
"spagnola",
|
||||
"spompinare",
|
||||
"sticchio",
|
||||
"stronza",
|
||||
"stronzata",
|
||||
"stronzo",
|
||||
"succhiami",
|
||||
"sveltina",
|
||||
"sverginare",
|
||||
"tarzanello",
|
||||
"terrone",
|
||||
"testa di cazzo",
|
||||
"tette",
|
||||
"tirare",
|
||||
"topa",
|
||||
"troia",
|
||||
"troietta",
|
||||
"troiona",
|
||||
"troione",
|
||||
"trombare",
|
||||
"uccello",
|
||||
"vacca",
|
||||
"vaffanculo",
|
||||
"vangare",
|
||||
"venire",
|
||||
"zinne",
|
||||
"zio cantante",
|
||||
"zoccola"
|
||||
'leccaculo',
|
||||
'lecchino',
|
||||
'lofare',
|
||||
'loffa',
|
||||
'loffare',
|
||||
'lumaca',
|
||||
'manico',
|
||||
'mannaggia',
|
||||
'merda',
|
||||
'merdata',
|
||||
'merdoso',
|
||||
'mignotta',
|
||||
'minchia',
|
||||
'minchione',
|
||||
'mona',
|
||||
'monta',
|
||||
'montare',
|
||||
'mussa',
|
||||
'nave scuola',
|
||||
'nerchia',
|
||||
'nudo',
|
||||
'padulo',
|
||||
'palle',
|
||||
'palloso',
|
||||
'patacca',
|
||||
'patonza',
|
||||
'pecorina',
|
||||
'pesce',
|
||||
'picio',
|
||||
'pincare',
|
||||
'pipa',
|
||||
'pippone',
|
||||
'pipì',
|
||||
'pirla',
|
||||
'pisciare',
|
||||
'piscio',
|
||||
'pisello',
|
||||
'pistola',
|
||||
'pistolotto',
|
||||
'pomiciare',
|
||||
'pompa',
|
||||
'pompinara',
|
||||
'pompino',
|
||||
'porca madonna',
|
||||
'porca miseria',
|
||||
'porca puttana',
|
||||
'porca',
|
||||
'porco dio',
|
||||
'porco due',
|
||||
'porco zio',
|
||||
'potta',
|
||||
'puppami',
|
||||
'puttana',
|
||||
'quaglia',
|
||||
'recchione',
|
||||
'regina',
|
||||
'ricchione',
|
||||
'rincoglionire',
|
||||
'rizzarsi',
|
||||
'rompiballe',
|
||||
'rottinculo',
|
||||
'ruffiano',
|
||||
'sbattere',
|
||||
'sbattersi',
|
||||
'sborra',
|
||||
'sborrata',
|
||||
'sborrone',
|
||||
'sbrodolata',
|
||||
'scopare',
|
||||
'scopata',
|
||||
'scorreggiare',
|
||||
'sega',
|
||||
'segaiolo',
|
||||
'slinguare',
|
||||
'slinguata',
|
||||
'smandrappata',
|
||||
'soccia',
|
||||
'socmel',
|
||||
'sorca',
|
||||
'spagnola',
|
||||
'spompinare',
|
||||
'sticchio',
|
||||
'stronza',
|
||||
'stronzata',
|
||||
'stronzo',
|
||||
'succhiami',
|
||||
'sveltina',
|
||||
'sverginare',
|
||||
'tarzanello',
|
||||
'terrone',
|
||||
'testa di cazzo',
|
||||
'tette',
|
||||
'tirare',
|
||||
'topa',
|
||||
'troia',
|
||||
'troietta',
|
||||
'troiona',
|
||||
'troione',
|
||||
'trombare',
|
||||
'uccello',
|
||||
'vacca',
|
||||
'vaffanculo',
|
||||
'vangare',
|
||||
'venire',
|
||||
'zinne',
|
||||
'zio cantante',
|
||||
'zoccola',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -32,5 +32,5 @@ return [
|
|||
'geitenneuker',
|
||||
'pedo',
|
||||
'randdebiel',
|
||||
'lul'
|
||||
'lul',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,52 +2,52 @@
|
|||
|
||||
return [
|
||||
|
||||
/**
|
||||
/*
|
||||
* List of bad words without accent.
|
||||
*
|
||||
* Provided by @kotass
|
||||
*/
|
||||
|
||||
"kokot",
|
||||
"kokoti",
|
||||
"jebat",
|
||||
"jebnuty",
|
||||
"vyjebany",
|
||||
"buzerant",
|
||||
"pica",
|
||||
"pice",
|
||||
"hovno",
|
||||
"picus",
|
||||
"vyjebanec",
|
||||
"kurva",
|
||||
"skurvenec",
|
||||
"jebal",
|
||||
"kurvu",
|
||||
"buzik",
|
||||
"bukviciak",
|
||||
"chuj",
|
||||
"chumaj",
|
||||
"curak",
|
||||
"debil",
|
||||
"dement",
|
||||
"jebacka",
|
||||
"jeblina",
|
||||
"jebo",
|
||||
"popici",
|
||||
"ojeb",
|
||||
"ojebavat",
|
||||
"picovat",
|
||||
"rit",
|
||||
"skokoteny",
|
||||
"skurvit",
|
||||
"trtko",
|
||||
"ujeb",
|
||||
"ujebat",
|
||||
"jeba",
|
||||
"zmrd",
|
||||
"zjebat",
|
||||
"zajebany",
|
||||
"zapiceny",
|
||||
"vytrtkany"
|
||||
'kokot',
|
||||
'kokoti',
|
||||
'jebat',
|
||||
'jebnuty',
|
||||
'vyjebany',
|
||||
'buzerant',
|
||||
'pica',
|
||||
'pice',
|
||||
'hovno',
|
||||
'picus',
|
||||
'vyjebanec',
|
||||
'kurva',
|
||||
'skurvenec',
|
||||
'jebal',
|
||||
'kurvu',
|
||||
'buzik',
|
||||
'bukviciak',
|
||||
'chuj',
|
||||
'chumaj',
|
||||
'curak',
|
||||
'debil',
|
||||
'dement',
|
||||
'jebacka',
|
||||
'jeblina',
|
||||
'jebo',
|
||||
'popici',
|
||||
'ojeb',
|
||||
'ojebavat',
|
||||
'picovat',
|
||||
'rit',
|
||||
'skokoteny',
|
||||
'skurvit',
|
||||
'trtko',
|
||||
'ujeb',
|
||||
'ujebat',
|
||||
'jeba',
|
||||
'zmrd',
|
||||
'zjebat',
|
||||
'zajebany',
|
||||
'zapiceny',
|
||||
'vytrtkany',
|
||||
|
||||
];
|
||||
|
|
@ -83,5 +83,5 @@ return [
|
|||
'顏射',
|
||||
'肛交',
|
||||
'潮吹',
|
||||
'軟屌'
|
||||
'軟屌',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => 'The :attribute contains vulgar content'
|
||||
'profane' => 'The :attribute contains vulgar content',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => 'El :attribute contiene palabras vulgares'
|
||||
'profane' => 'El :attribute contiene palabras vulgares',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => 'Het :attribute veld bevat vulgaire inhoud'
|
||||
'profane' => 'Het :attribute veld bevat vulgaire inhoud',
|
||||
];
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => 'O campo :attribute contém palavras vulgares'
|
||||
'profane' => 'O campo :attribute contém palavras vulgares',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => ':attribute obsahuje vulgárny obsah'
|
||||
'profane' => ':attribute obsahuje vulgárny obsah',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'profane' => ':attribute欄位內容包含粗俗用詞,請您修正:)'
|
||||
'profane' => ':attribute欄位內容包含粗俗用詞,請您修正:)',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace LaravelProfaneTests;
|
||||
|
||||
use LaravelProfane\Dictionary;
|
||||
use LaravelProfaneTests\TestCase;
|
||||
|
||||
class DictionaryTest extends TestCase
|
||||
{
|
||||
|
|
@ -29,7 +28,7 @@ class DictionaryTest extends TestCase
|
|||
{
|
||||
$dictionary = new Dictionary([
|
||||
'es',
|
||||
'gr'
|
||||
'gr',
|
||||
]);
|
||||
|
||||
$expected = array_merge(
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace LaravelProfaneTests;
|
||||
|
||||
use LaravelProfane\ProfaneValidator;
|
||||
use LaravelProfaneTests\TestCase;
|
||||
use LaravelProfaneTests\Support\ProfaneValidatorBuilder;
|
||||
|
||||
class ProfaneValidatorTest extends TestCase
|
||||
|
|
@ -73,7 +71,7 @@ class ProfaneValidatorTest extends TestCase
|
|||
{
|
||||
$builder = new ProfaneValidatorBuilder('sk');
|
||||
|
||||
$word = "piča";
|
||||
$word = 'piča';
|
||||
|
||||
$this->assertTrue($builder->build()->isProfane($word));
|
||||
}
|
||||
|
|
@ -83,7 +81,7 @@ class ProfaneValidatorTest extends TestCase
|
|||
$builder = new ProfaneValidatorBuilder('es');
|
||||
|
||||
// in spanish coño =! cono
|
||||
$word = "coño";
|
||||
$word = 'coño';
|
||||
|
||||
$this->assertTrue($builder->build()->isProfane($word));
|
||||
}
|
||||
|
|
@ -94,7 +92,7 @@ class ProfaneValidatorTest extends TestCase
|
|||
|
||||
$builder = new ProfaneValidatorBuilder('gr');
|
||||
|
||||
$word = "μαλάκας";
|
||||
$word = 'μαλάκας';
|
||||
|
||||
$this->assertTrue($builder->build()->isProfane($word));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace LaravelProfaneTests;
|
||||
|
||||
use LaravelProfaneTests\TestCase;
|
||||
use LaravelProfane\Str;
|
||||
|
||||
class StrTest extends TestCase
|
||||
|
|
|
|||
|
|
@ -2,19 +2,21 @@
|
|||
|
||||
namespace LaravelProfaneTests\Support;
|
||||
|
||||
use LaravelProfane\ProfaneValidator;
|
||||
use LaravelProfane\Dictionary;
|
||||
use LaravelProfane\ProfaneValidator;
|
||||
|
||||
class ProfaneValidatorBuilder
|
||||
{
|
||||
/**
|
||||
* [$profaneValidator description]
|
||||
* [$profaneValidator description].
|
||||
*
|
||||
* @var [type]
|
||||
*/
|
||||
protected $profaneValidator;
|
||||
|
||||
/**
|
||||
* [__construct description]
|
||||
* [__construct description].
|
||||
*
|
||||
* @param [type] $dictionary [description]
|
||||
*/
|
||||
public function __construct($dictionary = null)
|
||||
|
|
@ -23,8 +25,10 @@ class ProfaneValidatorBuilder
|
|||
}
|
||||
|
||||
/**
|
||||
* [validate description]
|
||||
* [validate description].
|
||||
*
|
||||
* @param array $parameters [description]
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function validate(array $parameters)
|
||||
|
|
@ -35,7 +39,8 @@ class ProfaneValidatorBuilder
|
|||
}
|
||||
|
||||
/**
|
||||
* [build description]
|
||||
* [build description].
|
||||
*
|
||||
* @return LaravelProfane\ProfaneValidator
|
||||
*/
|
||||
public function build()
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
namespace LaravelProfaneTests;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Mockery;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use \Mockery;
|
||||
|
||||
class TestCase extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* [setUp description]
|
||||
* [setUp description].
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
|
|
@ -18,7 +18,8 @@ class TestCase extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* [tearDown description]
|
||||
* [tearDown description].
|
||||
*
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function tearDown()
|
||||
|
|
@ -28,7 +29,8 @@ class TestCase extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* [mockConfigs description]
|
||||
* [mockConfigs description].
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mockConfigs()
|
||||
|
|
|
|||
Loading…
Reference in New Issue