|
25 | 25 | #[CoversNothing]
|
26 | 26 | class StrTest extends TestCase
|
27 | 27 | {
|
| 28 | + public function testStringApa() |
| 29 | + { |
| 30 | + $this->assertSame('Tom and Jerry', Str::apa('tom and jerry')); |
| 31 | + $this->assertSame('Tom and Jerry', Str::apa('TOM AND JERRY')); |
| 32 | + $this->assertSame('Tom and Jerry', Str::apa('Tom And Jerry')); |
| 33 | + |
| 34 | + $this->assertSame('Back to the Future', Str::apa('back to the future')); |
| 35 | + $this->assertSame('Back to the Future', Str::apa('BACK TO THE FUTURE')); |
| 36 | + $this->assertSame('Back to the Future', Str::apa('Back To The Future')); |
| 37 | + |
| 38 | + $this->assertSame('This, Then That', Str::apa('this, then that')); |
| 39 | + $this->assertSame('This, Then That', Str::apa('THIS, THEN THAT')); |
| 40 | + $this->assertSame('This, Then That', Str::apa('This, Then That')); |
| 41 | + |
| 42 | + $this->assertSame('Bond. James Bond.', Str::apa('bond. james bond.')); |
| 43 | + $this->assertSame('Bond. James Bond.', Str::apa('BOND. JAMES BOND.')); |
| 44 | + $this->assertSame('Bond. James Bond.', Str::apa('Bond. James Bond.')); |
| 45 | + |
| 46 | + $this->assertSame('Self-Report', Str::apa('self-report')); |
| 47 | + $this->assertSame('Self-Report', Str::apa('Self-report')); |
| 48 | + $this->assertSame('Self-Report', Str::apa('SELF-REPORT')); |
| 49 | + |
| 50 | + $this->assertSame('As the World Turns, So Are the Days of Our Lives', Str::apa('as the world turns, so are the days of our lives')); |
| 51 | + $this->assertSame('As the World Turns, So Are the Days of Our Lives', Str::apa('AS THE WORLD TURNS, SO ARE THE DAYS OF OUR LIVES')); |
| 52 | + $this->assertSame('As the World Turns, So Are the Days of Our Lives', Str::apa('As The World Turns, So Are The Days Of Our Lives')); |
| 53 | + |
| 54 | + $this->assertSame('To Kill a Mockingbird', Str::apa('to kill a mockingbird')); |
| 55 | + $this->assertSame('To Kill a Mockingbird', Str::apa('TO KILL A MOCKINGBIRD')); |
| 56 | + $this->assertSame('To Kill a Mockingbird', Str::apa('To Kill A Mockingbird')); |
| 57 | + |
| 58 | + $this->assertSame('', Str::apa('')); |
| 59 | + $this->assertSame(' ', Str::apa(' ')); |
| 60 | + } |
| 61 | + |
28 | 62 | public function testCharAt()
|
29 | 63 | {
|
30 | 64 | $this->assertEquals('р', Str::charAt('Привет, мир!', 1));
|
|
0 commit comments