lithium\tests\cases\util\InflectorTest::testStorageMechanism PHP Method

testStorageMechanism() public method

Tests the storage mechanism for $_underscored, $_camelized, $_humanized and $_pluralized.
    public function testStorageMechanism()
    {
        Inflector::reset();
        $expected = array('TestField' => 'test_field');
        $this->assertEmpty($this->_getProtectedValue('$_underscored'));
        $this->assertEqual(Inflector::underscore('TestField'), 'test_field');
        $this->assertEqual($expected, $this->_getProtectedValue('$_underscored'));
        $this->assertEqual(Inflector::underscore('TestField'), 'test_field');
        $expected = array('test_field' => 'TestField');
        $this->assertEmpty($this->_getProtectedValue('$_camelized'));
        $this->assertEqual(Inflector::camelize('test_field', true), 'TestField');
        $this->assertEqual($expected, $this->_getProtectedValue('$_camelized'));
        $this->assertEqual(Inflector::camelize('test_field', true), 'TestField');
        $expected = array('test_field:_' => 'Test Field');
        $this->assertEmpty($this->_getProtectedValue('$_humanized'));
        $this->assertEqual(Inflector::humanize('test_field'), 'Test Field');
        $this->assertEqual($expected, $this->_getProtectedValue('$_humanized'));
        $this->assertEqual(Inflector::humanize('test_field'), 'Test Field');
        $expected = array('field' => 'fields');
        $this->assertEmpty($this->_getProtectedValue('$_pluralized'));
        $this->assertEqual(Inflector::pluralize('field'), 'fields');
        $this->assertEqual($expected, $this->_getProtectedValue('$_pluralized'));
        $this->assertEqual(Inflector::pluralize('field'), 'fields');
    }