Skip to content

Commit

Permalink
adding tests for #6003
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7995 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
AD7six committed Jan 14, 2009
1 parent 56afb72 commit 5af1835
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
27 changes: 27 additions & 0 deletions cake/tests/cases/libs/model/behaviors/tree.test.php
Expand Up @@ -1487,4 +1487,31 @@ class UnconventionalTreeCase extends NumberTreeCase {
*/
var $fixtures = array('core.unconventional_tree');
}
/**
* UuidTreeCase class
*
* @package cake
* @subpackage cake.tests.cases.libs.model.behaviors
*/
class UuidTreeCase extends NumberTreeCase {
/**
* settings property
*
* @var array
* @access public
*/
var $settings = array(
'modelClass' => 'UuidTree',
'leftField' => 'lft',
'rightField' => 'rght',
'parentField' => 'parent_id'
);
/**
* fixtures property
*
* @var array
* @access public
*/
var $fixtures = array('core.uuid_tree');
}
?>
18 changes: 17 additions & 1 deletion cake/tests/cases/libs/model/models.php
Expand Up @@ -2311,6 +2311,22 @@ class UnconventionalTree extends NumberTree {
)
);
}
/**
* UuidTree class
*
* @package cake.tests
* @subpackage cake.tests.cases.libs.model
*/
class UuidTree extends NumberTree {
/**
* name property
*
* @var string 'FlagTree'
* @access public
*/
var $name = 'UuidTree';
}

/**
* Campaign class
*
Expand Down Expand Up @@ -2909,7 +2925,7 @@ class FruitsUuidTag extends CakeTestModel {
'UuidTag' => array(
'className' => 'UuidTag',
'foreignKey' => 'uuid_tag_id',
),
),
'Fruit' => array(
'className' => 'Fruit',
'foreignKey' => 'fruit_id',
Expand Down
54 changes: 54 additions & 0 deletions cake/tests/fixtures/uuid_tree_fixture.php
@@ -0,0 +1,54 @@
<?php
/* SVN FILE: $Id$ */
/**
* UUID Tree behavior fixture.
*
* PHP versions 4 and 5
*
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The Open Group Test Suite License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests
* @subpackage cake.tests.fixtures
* @since CakePHP(tm) v 1.2.0.7984
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
* UuidTreeFixture class
*
* @uses CakeTestFixture
* @package cake
* @subpackage cake.tests.fixtures
*/
class UuidTreeFixture extends CakeTestFixture {
/**
* name property
*
* @var string 'UuidTree'
* @access public
*/
var $name = 'UuidTree';
/**
* fields property
*
* @var array
* @access public
*/
var $fields = array(
'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'),
'name' => array('type' => 'string','null' => false),
'parent_id' => array('type' => 'string', 'length' => 36),
'lft' => array('type' => 'integer','null' => false),
'rght' => array('type' => 'integer','null' => false)
);
}
?>

0 comments on commit 5af1835

Please sign in to comment.