Skip to content

Commit

Permalink
Add tests for null and false input to inflector methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 1, 2014
1 parent c731d7b commit 8458f54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/TestCase/Utility/InflectorTest.php
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
}

/**
Expand Down

0 comments on commit 8458f54

Please sign in to comment.