]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/EntityTest.php
Add socialite authentication for okta
[bookstack] / tests / Entity / EntityTest.php
index 07f1926c5b94f212e3f6064e41d5dccf834decd0..a43f65b5efd568c58d1ce6a8e9c9343276d1be07 100644 (file)
@@ -11,7 +11,6 @@ class EntityTest extends BrowserKitTest
 
     public function test_entity_creation()
     {
 
     public function test_entity_creation()
     {
-
         // Test Creation
         $book = $this->bookCreation();
         $chapter = $this->chapterCreation($book);
         // Test Creation
         $book = $this->bookCreation();
         $chapter = $this->chapterCreation($book);
@@ -257,4 +256,25 @@ class EntityTest extends BrowserKitTest
             ->seeInElement('#recently-updated-pages', $page->name);
     }
 
             ->seeInElement('#recently-updated-pages', $page->name);
     }
 
+    public function test_slug_multi_byte_lower_casing()
+    {
+        $entityRepo = app(EntityRepo::class);
+        $book = $entityRepo->createFromInput('book', [
+            'name' => 'КНИГА'
+        ]);
+
+        $this->assertEquals('книга', $book->slug);
+    }
+
+
+    public function test_slug_format()
+    {
+        $entityRepo = app(EntityRepo::class);
+        $book = $entityRepo->createFromInput('book', [
+            'name' => 'PartA / PartB / PartC'
+        ]);
+
+        $this->assertEquals('parta-partb-partc', $book->slug);
+    }
+
 }
 }