⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbo_source.test.php

📁 Cake Framwork , Excellent
💻 PHP
📖 第 1 页 / 共 5 页
字号:
			'className' => 'Article2',			'order'=>'Article2.published_date DESC',			'foreignKey' => 'category_id',			'limit'=>'3')	);/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'group_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'parent_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'name' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),				'icon' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),				'description' => array('type' => 'text', 'null' => false, 'default' => '', 'length' => null),			);		}		return $this->_schema;	}}/** * Article2 class * * @package              cake * @subpackage           cake.tests.cases.libs.model.datasources */class Article2 extends CakeTestModel {/** * name property * * @var string 'Article2' * @access public */	var $name = 'Article2';/** * table property * * @var string 'article' * @access public */	var $table = 'article';/** * useTable property * * @var bool false * @access public */	var $useTable = false;/** * belongsTo property * * @var array * @access public */	var $belongsTo = array(		'Category2' => array(  			'className' => 'Category2'		),		'User2' => array(			'className' => 'User2' 		) 	);/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'category_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'user_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'rate_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'rate_sum' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'viewed' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'version' => array('type' => 'string', 'null' => true, 'default' => '', 'length' => '45'),				'title' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '200'),				'intro' => array('text' => 'string', 'null' => true, 'default' => '', 'length' => null),				'comments' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '4'),				'body' => array('text' => 'string', 'null' => true, 'default' => '', 'length' => null),				'isdraft' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'length' => '1'),				'allow_comments' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'length' => '1'),				'moderate_comments' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'length' => '1'),				'published' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'length' => '1'),				'multipage' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'length' => '1'), 				'published_date' => array('type' => 'datetime', 'null' => true, 'default' => '', 'length' => null),				'created' => array('type' => 'datetime', 'null' => false, 'default' => '0000-00-00 00:00:00', 'length' => null),				'modified' => array('type' => 'datetime', 'null' => false, 'default' => '0000-00-00 00:00:00', 'length' => null)			);		}		return $this->_schema;	}}/** * CategoryFeatured2 class * * @package              cake * @subpackage           cake.tests.cases.libs.model.datasources */class CategoryFeatured2 extends CakeTestModel {/** * name property * * @var string 'CategoryFeatured2' * @access public */	var $name = 'CategoryFeatured2';/** * table property * * @var string 'category_featured' * @access public */	var $table = 'category_featured';/** * useTable property * * @var bool false * @access public */	var $useTable = false;/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'parent_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),				'name' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),				'icon' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),				'description' => array('text' => 'string', 'null' => false, 'default' => '', 'length' => null)			);		}		return $this->_schema;	}}/** * Featured2 class * * @package              cake * @subpackage           cake.tests.cases.libs.model.datasources */class Featured2 extends CakeTestModel {/** * name property * * @var string 'Featured2' * @access public */	var $name = 'Featured2';/** * table property * * @var string 'featured2' * @access public */	var $table = 'featured2';/** * useTable property * * @var bool false * @access public */	var $useTable = false;/** * belongsTo property * * @var array * @access public */	var $belongsTo = array(		'CategoryFeatured2' => array(			'className' => 'CategoryFeatured2'		)	);/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),				'article_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'category_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'name' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => '20')			);		}		return $this->_schema;	}}/** * Comment2 class * * @package              cake * @subpackage           cake.tests.cases.libs.model.datasources */class Comment2 extends CakeTestModel {/** * name property * * @var string 'Comment2' * @access public */	var $name = 'Comment2';/** * table property * * @var string 'comment' * @access public */	var $table = 'comment';/** * belongsTo property * * @var array * @access public */	var $belongsTo = array('ArticleFeatured2', 'User2');/** * useTable property * * @var bool false * @access public */	var $useTable = false;/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),				'article_featured_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'user_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'name' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => '20')			);		}		return $this->_schema;	}}/** * ArticleFeatured2 class * * @package              cake * @subpackage           cake.tests.cases.libs.model.datasources */class ArticleFeatured2 extends CakeTestModel {/** * name property * * @var string 'ArticleFeatured2' * @access public */	var $name = 'ArticleFeatured2';/** * table property * * @var string 'article_featured' * @access public */	var $table = 'article_featured';/** * useTable property * * @var bool false * @access public */	var $useTable = false;/** * belongsTo property * * @var array * @access public */	var $belongsTo = array(		'CategoryFeatured2' => array(  			'className' => 'CategoryFeatured2'		),		'User2' => array(			'className' => 'User2' 		) 	);/** * hasOne property * * @var array * @access public */ 	var $hasOne = array( 		'Featured2' => array('className' => 'Featured2') 	);/** * hasMany property * * @var array * @access public */	var $hasMany = array(		'Comment2' => array('className'=>'Comment2', 'dependent' => true)	);/** * schema method * * @access public * @return void */	function schema() {		if (!isset($this->_schema)) {			$this->_schema = array(				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),				'category_featured_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'user_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),				'title' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => '20'),				'body' => array('text' => 'string', 'null' => true, 'default' => '', 'length' => null),				'published' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'length' => '1'),				'published_date' => array('type' => 'datetime', 'null' => true, 'default' => '', 'length' => null),				'created' => array('type' => 'datetime', 'null' => false, 'default' => '0000-00-00 00:00:00', 'length' => null),				'modified' => array('type' => 'datetime', 'null' => false, 'default' => '0000-00-00 00:00:00', 'length' => null)			);		}		return $this->_schema;	}}/** * Short description for class. * * @package		cake.tests * @subpackage	cake.tests.cases.libs.model.datasources */class DboSourceTest extends CakeTestCase {/** * debug property * * @var mixed null * @access public */	var $debug = null;/** * autoFixtures property * * @var bool false * @access public */	var $autoFixtures = false;/** * fixtures property * * @var array * @access public */	var $fixtures = array(		'core.apple', 'core.article', 'core.articles_tag', 'core.attachment', 'core.comment',		'core.sample', 'core.tag', 'core.user', 'core.post', 'core.author'	);/** * startTest method * * @access public * @return void */	function startTest() {		$this->__config = $this->db->config;		if (!class_exists('DboTest')) {			$db = ConnectionManager::getDataSource('test_suite');			$class = get_class($db);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -