Skip to content
Permalink
Browse files

Add tests for null and false input to inflector methods.

  • Loading branch information...
ADmad committed Sep 1, 2014
1 parent c731d7b commit 8458f548a7bf837b2eb8fcf420d1c83e1506ebb2
Showing with 3 additions and 0 deletions.
  1. +3 −0 tests/TestCase/Utility/InflectorTest.php
@@ -388,6 +388,7 @@ public function testInflectorHyphenate() {
$this->assertSame('test-this-thing', Inflector::hyphenate('test_this_thing'));
// Test stupid values
$this->assertSame('', Inflector::hyphenate(null));
$this->assertSame('', Inflector::hyphenate(''));
$this->assertSame('0', Inflector::hyphenate(0));
$this->assertSame('', Inflector::hyphenate(false));
@@ -438,6 +439,8 @@ public function testHumanization() {
$this->assertEquals(Inflector::humanize('posts'), 'Posts');
$this->assertEquals(Inflector::humanize('posts_tags'), 'Posts Tags');
$this->assertEquals(Inflector::humanize('file_systems'), 'File Systems');
$this->assertSame('', Inflector::humanize(null));
$this->assertSame('', Inflector::humanize(false));
}
/**

0 comments on commit 8458f54

Please sign in to comment.
You can’t perform that action at this time.