From ca202c1819f09ebe2569342e3e6582a3e96b7c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Corte=CC=81s=20=28DrZippie=29?= Date: Thu, 25 Jun 2020 18:08:13 +0200 Subject: [PATCH 1/2] Added Illuminate\Support\Str::slug to generate slug from text to improve the creation of slugs with non-English characters --- app/Entities/SlugGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Entities/SlugGenerator.php b/app/Entities/SlugGenerator.php index 459a5264a..e8bc556ab 100644 --- a/app/Entities/SlugGenerator.php +++ b/app/Entities/SlugGenerator.php @@ -1,5 +1,7 @@ Date: Thu, 25 Jun 2020 18:42:28 +0200 Subject: [PATCH 2/2] removed test_slug_multi_byte_lower_casing and added new test test_slug_multi_byte_url_safe --- tests/Entity/EntityTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/Entity/EntityTest.php b/tests/Entity/EntityTest.php index d7e4ec61c..de1e025ad 100644 --- a/tests/Entity/EntityTest.php +++ b/tests/Entity/EntityTest.php @@ -273,15 +273,20 @@ class EntityTest extends BrowserKitTest ->seeInElement('#recently-updated-pages', $page->name); } - public function test_slug_multi_byte_lower_casing() + public function test_slug_multi_byte_url_safe() { $book = $this->newBook([ - 'name' => 'КНИГА' + 'name' => 'информация' ]); - $this->assertEquals('книга', $book->slug); - } + $this->assertEquals('informatsiya', $book->slug); + $book = $this->newBook([ + 'name' => '¿Qué?' + ]); + + $this->assertEquals('que', $book->slug); + } public function test_slug_format() {