Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding more tests to check cache paths and stupid values.

  • Loading branch information...
commit 0959de60310a323abfb0de3850d8ecae9bfe5527 1 parent 3bd8bd2
@predominant predominant authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 cake/tests/cases/libs/inflector.test.php
View
11 cake/tests/cases/libs/inflector.test.php
@@ -256,6 +256,17 @@ function testInflectorUnderscore() {
$this->assertIdentical(Inflector::underscore('testThing'), 'test_thing');
$this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra');
$this->assertIdentical(Inflector::underscore('testThingExtra'), 'test_thing_extra');
+
+ // Identical checks test the cache code path.
+ $this->assertIdentical(Inflector::underscore('TestThing'), 'test_thing');
+ $this->assertIdentical(Inflector::underscore('testThing'), 'test_thing');
+ $this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra');
+ $this->assertIdentical(Inflector::underscore('testThingExtra'), 'test_thing_extra');
+
+ // Test stupid values
+ $this->assertIdentical(Inflector::underscore(''), '');
+ $this->assertIdentical(Inflector::underscore(0), '0');
+ $this->assertIdentical(Inflector::underscore(false), '');
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.