mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
"Fixing inflection of people uninflected plural.
Renamed PersonFixture. Fixed ModelTest::testHabtmFinderQuery() test when prefix is used." git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6612 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
2eb120486b
commit
c849dd773a
4 changed files with 19 additions and 8 deletions
|
@ -102,7 +102,7 @@ class Inflector extends Object {
|
|||
'equipment', 'Faroese', 'flounder', 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti',
|
||||
'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', 'jackanapes', 'Kiplingese',
|
||||
'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media', 'mews', 'moose', 'mumps', 'Nankingese', 'news',
|
||||
'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings',
|
||||
'nexus', 'Niasese', 'Pekingese', 'People', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings',
|
||||
'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', 'series', 'Shavese', 'shears',
|
||||
'siemens', 'species', 'swine', 'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese',
|
||||
'whiting', 'wildebeest', 'Yengeese',);
|
||||
|
|
|
@ -161,6 +161,10 @@ class InflectorTest extends UnitTestCase {
|
|||
$result = $this->Inflector->singularize('viri');
|
||||
$expected = 'virus';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Inflector->singularize('people');
|
||||
$expected = 'person';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testInflectingPlurals() {
|
||||
|
@ -283,6 +287,14 @@ class InflectorTest extends UnitTestCase {
|
|||
$result = $this->Inflector->pluralize('virus');
|
||||
$expected = 'viri';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Inflector->pluralize('person');
|
||||
$expected = 'people';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Inflector->pluralize('people');
|
||||
$expected = 'people';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testInflectorSlug() {
|
||||
|
|
|
@ -48,7 +48,7 @@ class ModelTest extends CakeTestCase {
|
|||
'core.syfile', 'core.image', 'core.device_type', 'core.device_type_category', 'core.feature_set', 'core.exterior_type_category',
|
||||
'core.document', 'core.device', 'core.document_directory', 'core.primary_model', 'core.secondary_model', 'core.something',
|
||||
'core.something_else', 'core.join_thing', 'core.join_a', 'core.join_b', 'core.join_c', 'core.join_a_b', 'core.join_a_c',
|
||||
'core.uuid', 'core.data_test', 'core.posts_tag', 'core.the_paper_monkies', 'core.people'
|
||||
'core.uuid', 'core.data_test', 'core.posts_tag', 'core.the_paper_monkies', 'core.person'
|
||||
);
|
||||
|
||||
function start() {
|
||||
|
@ -143,13 +143,13 @@ class ModelTest extends CakeTestCase {
|
|||
$sql = $db->buildStatement(
|
||||
array(
|
||||
'fields' => $db->fields($this->Article->Tag, null, array('Tag.id', 'Tag.tag', 'ArticlesTag.article_id', 'ArticlesTag.tag_id')),
|
||||
'table' => 'tags',
|
||||
'table' => $db->fullTableName('tags'),
|
||||
'alias' => 'Tag',
|
||||
'limit' => null,
|
||||
'offset' => null,
|
||||
'joins' => array(array(
|
||||
'alias' => 'ArticlesTag',
|
||||
'table' => 'articles_tags',
|
||||
'table' => $db->fullTableName('articles_tags'),
|
||||
'conditions' => array(
|
||||
array("ArticlesTag.article_id" => '{$__cakeID__$}'),
|
||||
array("ArticlesTag.tag_id" => '{$__cakeIdentifier[Tag.id]__$}')
|
||||
|
@ -376,7 +376,7 @@ class ModelTest extends CakeTestCase {
|
|||
}
|
||||
|
||||
function testFindSelfAssociations() {
|
||||
$this->loadFixtures('People');
|
||||
$this->loadFixtures('Person');
|
||||
$this->model =& new Person();
|
||||
$this->model->recursive = 2;
|
||||
$result = $this->model->read(null, 1);
|
||||
|
@ -3426,5 +3426,4 @@ class ModelTest extends CakeTestCase {
|
|||
ClassRegistry::flush();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
4
cake/tests/fixtures/person_fixture.php
vendored
4
cake/tests/fixtures/person_fixture.php
vendored
|
@ -32,8 +32,8 @@
|
|||
* @package cake.tests
|
||||
* @subpackage cake.tests.fixtures
|
||||
*/
|
||||
class PeopleFixture extends CakeTestFixture {
|
||||
var $name = 'People';
|
||||
class PersonFixture extends CakeTestFixture {
|
||||
var $name = 'Person';
|
||||
var $fields = array(
|
||||
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
|
||||
'name' => array('type'=>'string', 'null' => false, 'length' => 32),
|
||||
|
|
Loading…
Add table
Reference in a new issue