From 57c6823cf3828cb941bdf1af5a6b2633fbfb89e1 Mon Sep 17 00:00:00 2001 From: "S.a Mahmoudzadeh" <36761585+saMahmoudzadeh@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:57:49 +0330 Subject: [PATCH] [11.x] improvement test for string title (#51015) * test(SupportStrTest.php): improvement test for string title * test(SupportStrTest.php): add test for special characters * fix: code style --- tests/Support/SupportStrTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index 78d970cc5091..909699b7a266 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -37,6 +37,17 @@ public function testStringTitle() { $this->assertSame('Jefferson Costella', Str::title('jefferson costella')); $this->assertSame('Jefferson Costella', Str::title('jefFErson coSTella')); + + $this->assertSame('', Str::title('')); + $this->assertSame('123 Laravel', Str::title('123 laravel')); + $this->assertSame('❤Laravel', Str::title('❤laravel')); + $this->assertSame('Laravel ❤', Str::title('laravel ❤')); + $this->assertSame('Laravel123', Str::title('laravel123')); + $this->assertSame('Laravel123', Str::title('Laravel123')); + + $longString = 'lorem ipsum '.str_repeat('dolor sit amet ', 1000); + $expectedResult = 'Lorem Ipsum Dolor Sit Amet '.str_repeat('Dolor Sit Amet ', 999); + $this->assertSame($expectedResult, Str::title($longString)); } public function testStringHeadline()