From 212b3490267be2ca8f8b7737751999779002cfca Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 11 Oct 2011 00:24:42 -0400 Subject: [PATCH] Added Str tests. --- tests/Cases/StrTest.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Cases/StrTest.php diff --git a/tests/Cases/StrTest.php b/tests/Cases/StrTest.php new file mode 100644 index 00000000..8f333186 --- /dev/null +++ b/tests/Cases/StrTest.php @@ -0,0 +1,38 @@ +assertEquals('something', Laravel\Str::lower('SomeThing')); + $this->assertEquals('τάχιστη', Laravel\Str::lower('ΤΆΧΙΣΤΗ')); + } + + public function test_upper() + { + $this->assertEquals('SPEAK LOUDER', Laravel\Str::upper('speak louder')); + $this->assertEquals('ΤΆΧΙΣΤΗ', Laravel\Str::upper('Τάχιστη')); + } + + public function test_title() + { + $this->assertEquals('This Is A Test', Laravel\Str::title('this is a test')); + $this->assertEquals('Τάχιστη Τάχιστη', Laravel\Str::title('τάχιστη τάχιστη')); + } + + public function test_length() + { + $this->assertEquals(4, Laravel\Str::length('four')); + $this->assertEquals(7, Laravel\Str::length('τάχιστη')); + } + + public function test_ascii() + { + $this->assertEquals('Deuxieme Article', Laravel\Str::ascii('Deuxième Article')); + } + + public function test_random() + { + $this->assertEquals(5, strlen(Laravel\Str::random(5))); + } +} \ No newline at end of file