From 6ca03ac9a9186f6d32b6fa0b4e2ebe3921c754a6 Mon Sep 17 00:00:00 2001 From: Rachid Date: Sun, 11 Oct 2020 16:51:00 -0400 Subject: [PATCH 1/3] Added FR and CA-FR profane words --- src/dict/fr-ca.php | 32 ++++++++++++ src/dict/fr.php | 124 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 src/dict/fr-ca.php create mode 100644 src/dict/fr.php diff --git a/src/dict/fr-ca.php b/src/dict/fr-ca.php new file mode 100644 index 0000000..492d3a0 --- /dev/null +++ b/src/dict/fr-ca.php @@ -0,0 +1,32 @@ + Date: Sun, 11 Oct 2020 16:59:52 -0400 Subject: [PATCH 2/3] Added tests for french and french-canadian. --- tests/ProfaneValidatorTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/ProfaneValidatorTest.php b/tests/ProfaneValidatorTest.php index 8b0617e..fa24664 100644 --- a/tests/ProfaneValidatorTest.php +++ b/tests/ProfaneValidatorTest.php @@ -105,4 +105,22 @@ class ProfaneValidatorTest extends TestCase $this->assertFalse($builder->validate(['description', 'εισαι πουτανα', ['en', 'gr']])); } + + public function test_can_validate_a_word_in_french() + { + $this->mockConfigs(); + + $builder = new ProfaneValidatorBuilder(); + + $this->assertFalse($builder->validate(['description', 'Va te faire enculer, sac à merde', ['en', 'fr']])); + } + + public function test_can_validate_a_word_in_french_canadian() + { + $this->mockConfigs(); + + $builder = new ProfaneValidatorBuilder(); + + $this->assertFalse($builder->validate(['description', 'Décrisse gros cave', ['en', 'fr-ca']])); + } } From c12cb57e60a9c12908ccd064f78fa65d9607b189 Mon Sep 17 00:00:00 2001 From: Rachid Date: Sun, 11 Oct 2020 17:05:36 -0400 Subject: [PATCH 3/3] Added french validation file --- src/lang/fr/validation.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/lang/fr/validation.php diff --git a/src/lang/fr/validation.php b/src/lang/fr/validation.php new file mode 100644 index 0000000..286066c --- /dev/null +++ b/src/lang/fr/validation.php @@ -0,0 +1,5 @@ + 'Le champ :attribute comporte du contenu vulgaire', +];