a tiny mvc framework for php using php-activerecord
at v1 29 lines 782 B view raw
1<?php 2include 'helpers/config.php'; 3require_once __DIR__ . '/../lib/Inflector.php'; 4 5class InflectorTest extends SnakeCase_PHPUnit_Framework_TestCase 6{ 7 public function set_up() 8 { 9 $this->inflector = ActiveRecord\Inflector::instance(); 10 } 11 12 public function test_underscorify() 13 { 14 $this->assert_equals('rm__name__bob',$this->inflector->variablize('rm--name bob')); 15 $this->assert_equals('One_Two_Three',$this->inflector->underscorify('OneTwoThree')); 16 } 17 18 public function test_tableize() 19 { 20 $this->assert_equals('angry_people',$this->inflector->tableize('AngryPerson')); 21 $this->assert_equals('my_sqls',$this->inflector->tableize('MySQL')); 22 } 23 24 public function test_keyify() 25 { 26 $this->assert_equals('building_type_id', $this->inflector->keyify('BuildingType')); 27 } 28}; 29?>