📄 dbo_source.test.php
字号:
<?php/* SVN FILE: $Id: dbo_source.test.php 7125 2008-06-05 15:06:49Z gwoo $ *//** * Short description for file. * * Long description for file * * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * 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. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision: 7125 $ * @modifiedby $LastChangedBy: gwoo $ * @lastmodified $Date: 2008-06-05 08:06:49 -0700 (Thu, 05 Jun 2008) $ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { define('CAKEPHP_UNIT_TEST_EXECUTION', 1);}uses('model'.DS.'model', 'model'.DS.'datasources'.DS.'datasource', 'model'.DS.'datasources'.DS.'dbo_source', 'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_mysql');require_once dirname(dirname(__FILE__)) . DS . 'models.php';/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel extends CakeTestModel {/** * name property * * @var string 'TestModel' * @access public */ var $name = 'TestModel';/** * useTable property * * @var bool false * @access public */ var $useTable = false;/** * schema property * * @var array * @access protected */ var $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'client_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '11'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'login' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'passwd' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '255'), 'addr_1' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '255'), 'addr_2' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '25'), 'zip_code' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'city' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'country' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'phone' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'fax' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'url' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '255'), 'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), 'comments' => array('type' => 'text', 'null' => '1', 'default' => '', 'length' => '155'), 'last_login' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => ''), 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) );/** * find method * * @param mixed $conditions * @param mixed $fields * @param mixed $order * @param mixed $recursive * @access public * @return void */ function find($conditions = null, $fields = null, $order = null, $recursive = null) { return $conditions; }/** * findAll method * * @param mixed $conditions * @param mixed $fields * @param mixed $order * @param mixed $recursive * @access public * @return void */ function findAll($conditions = null, $fields = null, $order = null, $recursive = null) { return $conditions; }}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel2 extends CakeTestModel {/** * name property * * @var string 'TestModel2' * @access public */ var $name = 'TestModel2';/** * useTable property * * @var bool false * @access public */ var $useTable = false;}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel3 extends CakeTestModel {/** * name property * * @var string 'TestModel3' * @access public */ var $name = 'TestModel3';/** * useTable property * * @var bool false * @access public */ var $useTable = false;}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel4 extends CakeTestModel {/** * name property * * @var string 'TestModel4' * @access public */ var $name = 'TestModel4';/** * table property * * @var string 'test_model4' * @access public */ var $table = 'test_model4';/** * useTable property * * @var bool false * @access public */ var $useTable = false;/** * belongsTo property * * @var array * @access public */ var $belongsTo = array( 'TestModel4Parent' => array( 'className' => 'TestModel4', 'foreignKey' => 'parent_id' ) );/** * hasOne property * * @var array * @access public */ var $hasOne = array( 'TestModel5' => array( 'className' => 'TestModel5', 'foreignKey' => 'test_model4_id' ) );/** * hasAndBelongsToMany property * * @var array * @access public */ var $hasAndBelongsToMany = array('TestModel7' => array( 'className' => 'TestModel7', 'joinTable' => 'test_model4_test_model7', 'foreignKey' => 'test_model4_id', 'associationForeignKey' => 'test_model7_id' ));/** * schema method * * @access public * @return void */ function schema() { if (!isset($this->_schema)) { $this->_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) ); } return $this->_schema; }}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel5 extends CakeTestModel {/** * name property * * @var string 'TestModel5' * @access public */ var $name = 'TestModel5';/** * table property * * @var string 'test_model5' * @access public */ var $table = 'test_model5';/** * useTable property * * @var bool false * @access public */ var $useTable = false;/** * belongsTo property * * @var array * @access public */ var $belongsTo = array('TestModel4' => array( 'className' => 'TestModel4', 'foreignKey' => 'test_model4_id' ));/** * hasMany property * * @var array * @access public */ var $hasMany = array('TestModel6' => array( 'className' => 'TestModel6', 'foreignKey' => 'test_model5_id' ));/** * schema method * * @access public * @return void */ function schema() { if (!isset($this->_schema)) { $this->_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'test_model4_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) ); } return $this->_schema; }}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel6 extends CakeTestModel {/** * name property * * @var string 'TestModel6' * @access public */ var $name = 'TestModel6';/** * table property * * @var string 'test_model6' * @access public */ var $table = 'test_model6';/** * useTable property * * @var bool false * @access public */ var $useTable = false;/** * belongsTo property * * @var array * @access public */ var $belongsTo = array('TestModel5' => array( 'className' => 'TestModel5', 'foreignKey' => 'test_model5_id' ));/** * schema method * * @access public * @return void */ function schema() { if (!isset($this->_schema)) { $this->_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'test_model5_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) ); } return $this->_schema; }}/** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.model.datasources */class TestModel7 extends CakeTestModel {/** * name property * * @var string 'TestModel7' * @access public */ var $name = 'TestModel7';/** * table property * * @var string 'test_model7' * @access public */ var $table = 'test_model7';/** * useTable property *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -