コード例 #1
0
ファイル: InflectorSpec.php プロジェクト: ssgonchar/inflector
     });
 });
 describe("::camelize()", function () {
     it("camelizes a string", function () {
         expect(Inflector::camelize('test-field'))->toBe('TestField');
         expect(Inflector::camelize('test_field'))->toBe('TestField');
         expect(Inflector::camelize('TEST_FIELD'))->toBe('TestField');
         expect(Inflector::camelize('my_name\\space'))->toBe('MyName\\Space');
     });
 });
 describe("::camelback()", function () {
     it("camelbacks a string", function () {
         expect(Inflector::camelback('test-field'))->toBe('testField');
         expect(Inflector::camelback('test field'))->toBe('testField');
         expect(Inflector::camelback('TEST_FIELD'))->toBe('testField');
         expect(Inflector::camelback('my_name\\space'))->toBe('myName\\Space');
     });
 });
 describe("::titleize()", function () {
     it("titleizes a string", function () {
         expect(Inflector::titleize('posts'))->toBe('Posts');
         expect(Inflector::titleize('posts_tags'))->toBe('Posts Tags');
         expect(Inflector::titleize('file_systems'))->toBe('File Systems');
         expect(Inflector::titleize('the-post-title', '-'))->toBe('The Post Title');
     });
 });
 describe("::humanize()", function () {
     it("humanizes a string", function () {
         expect(Inflector::humanize('posts'))->toBe('Posts');
         expect(Inflector::humanize('post_id'))->toBe('Post');
         expect(Inflector::humanize('posts_tags'))->toBe('Posts tags');