mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Improved test for #2360
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4806 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f18ebf2117
commit
5eaa76afe0
1 changed files with 9 additions and 6 deletions
|
@ -77,7 +77,10 @@
|
||||||
var $primaryKey = 'id';
|
var $primaryKey = 'id';
|
||||||
var $name = 'UserForm';
|
var $name = 'UserForm';
|
||||||
|
|
||||||
var $hasMany = array('OpenidUrl');
|
var $hasMany = array('OpenidUrl' => array(
|
||||||
|
'className' => 'OpenidUrl',
|
||||||
|
'foreignKey' => 'user_form_id'
|
||||||
|
));
|
||||||
|
|
||||||
function loadInfo() {
|
function loadInfo() {
|
||||||
return new Set(array(
|
return new Set(array(
|
||||||
|
@ -100,12 +103,15 @@
|
||||||
var $primaryKey = 'id';
|
var $primaryKey = 'id';
|
||||||
var $name = 'OpenidUrl';
|
var $name = 'OpenidUrl';
|
||||||
|
|
||||||
var $belongsTo = array('UserForm');
|
var $belongsTo = array('UserForm' => array(
|
||||||
|
'className' => 'UserForm',
|
||||||
|
'foreignKey' => 'user_form_id'
|
||||||
|
));
|
||||||
|
|
||||||
function loadInfo() {
|
function loadInfo() {
|
||||||
return new Set(array(
|
return new Set(array(
|
||||||
array('name' => 'id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
array('name' => 'id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
||||||
array('name' => 'user_id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
array('name' => 'user_form_id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
|
||||||
array('name' => 'url', 'type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
array('name' => 'url', 'type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -134,10 +140,7 @@ class FormHelperTest extends UnitTestCase {
|
||||||
|
|
||||||
function testFormValidationAssociated() {
|
function testFormValidationAssociated() {
|
||||||
$this->UserForm = new UserForm();
|
$this->UserForm = new UserForm();
|
||||||
ClassRegistry::addObject('UserForm', $this->UserForm);
|
|
||||||
|
|
||||||
$this->UserForm->OpenidUrl = new OpenidUrl();
|
$this->UserForm->OpenidUrl = new OpenidUrl();
|
||||||
ClassRegistry::addObject('OpenidUrl', $this->UserForm->OpenidUrl);
|
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'UserForm' => array(
|
'UserForm' => array(
|
||||||
|
|
Loading…
Reference in a new issue