2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Short description for file.
|
|
|
|
*
|
2010-10-03 12:31:21 -04:00
|
|
|
* PHP 5
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-05-18 22:15:13 -03:00
|
|
|
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
2011-05-29 17:31:39 -04:00
|
|
|
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-10-03 12:31:21 -04:00
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2011-05-29 17:31:39 -04:00
|
|
|
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-05-18 22:15:13 -03:00
|
|
|
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
2011-07-26 01:46:14 -04:30
|
|
|
* @package Cake.TestSuite.Fixture
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 1.2.0.4667
|
2010-10-03 12:27:27 -04:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-12-08 01:49:36 -04:30
|
|
|
|
|
|
|
App::uses('Model', 'Model');
|
2009-07-24 21:18:37 +02:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Short description for class.
|
|
|
|
*
|
2011-07-26 01:46:14 -04:30
|
|
|
* @package Cake.TestSuite.Fixture
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class CakeTestModel extends Model {
|
2010-09-19 22:11:31 -04:30
|
|
|
public $useDbConfig = 'test';
|
2010-04-04 17:14:00 +10:00
|
|
|
public $cacheSources = false;
|
2011-11-22 21:50:17 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor, sets default order for the model to avoid failing tests caused by
|
|
|
|
* incorrect order when no order has been defined in the finds.
|
|
|
|
* Postgres can return the results in any order it considers appropriate if none is specified
|
|
|
|
*
|
|
|
|
* @param mixed $id Set this ID for this model on startup, can also be an array of options, see Model::__construct().
|
|
|
|
* @param string $table Name of database table to use.
|
|
|
|
* @param string $ds DataSource connection name.
|
|
|
|
*/
|
|
|
|
function __construct($id = false, $table = null, $ds = null) {
|
|
|
|
parent::__construct($id, $table, $ds);
|
|
|
|
if ($this->useTable && $this->primaryKey && $this->schema($this->primaryKey)) {
|
|
|
|
$this->order = array($this->alias . '.' . $this->primaryKey => 'ASC');
|
2011-11-23 01:32:27 +01:00
|
|
|
$this->_schema = null;
|
2011-11-22 21:50:17 +01:00
|
|
|
}
|
2011-11-23 01:32:27 +01:00
|
|
|
$this->_sourceConfigured = false;
|
2011-11-22 21:50:17 +01:00
|
|
|
}
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|