2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* ModelTest file
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2017-06-10 22:15:34 +00:00
|
|
|
* CakePHP(tm) Tests <https://book.cakephp.org/2.0/en/development/testing.html>
|
2017-06-10 22:10:52 +00:00
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-10-03 16:31:21 +00:00
|
|
|
* Licensed under The MIT License
|
2013-02-08 12:22:51 +00:00
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
2010-10-03 16:31:21 +00:00
|
|
|
* Redistributions of files must retain the above copyright notice
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2017-06-10 22:10:52 +00:00
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
2017-06-10 22:15:34 +00:00
|
|
|
* @link https://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Test.Case.Model
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 1.2.0.4206
|
2017-06-10 22:23:14 +00:00
|
|
|
* @license https://opensource.org/licenses/mit-license.php MIT License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-12-09 05:55:24 +00:00
|
|
|
|
|
|
|
App::uses('Model', 'Model');
|
|
|
|
App::uses('AppModel', 'Model');
|
2013-11-18 10:56:00 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
require_once dirname(__FILE__) . DS . 'models.php';
|
2009-07-08 03:25:30 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2009-07-04 19:23:22 +00:00
|
|
|
* ModelBaseTest
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Test.Case.Model
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-06-01 04:20:03 +00:00
|
|
|
abstract class BaseModelTest extends CakeTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* autoFixtures property
|
2008-06-14 20:39:27 +00:00
|
|
|
*
|
2014-07-03 13:36:42 +00:00
|
|
|
* @var bool
|
2008-06-02 19:22:55 +00:00
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $autoFixtures = false;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-06-02 05:00:52 +00:00
|
|
|
/**
|
|
|
|
* Whether backup global state for each test method or not
|
|
|
|
*
|
2014-07-03 13:36:42 +00:00
|
|
|
* @var bool
|
2010-06-02 05:00:52 +00:00
|
|
|
*/
|
|
|
|
public $backupGlobals = false;
|
2011-12-06 20:52:48 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* fixtures property
|
2008-06-14 20:39:27 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @var array
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $fixtures = array(
|
2008-11-09 03:20:14 +00:00
|
|
|
'core.category', 'core.category_thread', 'core.user', 'core.my_category', 'core.my_product',
|
|
|
|
'core.my_user', 'core.my_categories_my_users', 'core.my_categories_my_products',
|
|
|
|
'core.article', 'core.featured', 'core.article_featureds_tags', 'core.article_featured',
|
2012-06-18 14:40:37 +00:00
|
|
|
'core.numeric_article', 'core.tag', 'core.articles_tag', 'core.comment',
|
2008-11-09 03:20:14 +00:00
|
|
|
'core.attachment', 'core.apple', 'core.sample', 'core.another_article', 'core.item',
|
|
|
|
'core.advertisement', 'core.home', 'core.post', 'core.author', 'core.bid', 'core.portfolio',
|
|
|
|
'core.product', 'core.project', 'core.thread', 'core.message', 'core.items_portfolio',
|
|
|
|
'core.syfile', 'core.image', 'core.device_type', 'core.device_type_category',
|
|
|
|
'core.feature_set', 'core.exterior_type_category', 'core.document', 'core.device',
|
|
|
|
'core.document_directory', 'core.primary_model', 'core.secondary_model', 'core.something',
|
|
|
|
'core.something_else', 'core.join_thing', 'core.join_a', 'core.join_b', 'core.join_c',
|
2016-01-21 19:01:48 +00:00
|
|
|
'core.join_a_b', 'core.join_a_c', 'core.uuid', 'core.uuid_native', 'core.data_test', 'core.posts_tag',
|
2008-11-09 03:20:14 +00:00
|
|
|
'core.the_paper_monkies', 'core.person', 'core.underscore_field', 'core.node',
|
|
|
|
'core.dependency', 'core.story', 'core.stories_tag', 'core.cd', 'core.book', 'core.basket',
|
|
|
|
'core.overall_favorite', 'core.account', 'core.content', 'core.content_account',
|
|
|
|
'core.film_file', 'core.test_plugin_article', 'core.test_plugin_comment', 'core.uuiditem',
|
2009-04-22 16:47:34 +00:00
|
|
|
'core.counter_cache_user', 'core.counter_cache_post',
|
|
|
|
'core.counter_cache_user_nonstandard_primary_key',
|
|
|
|
'core.counter_cache_post_nonstandard_primary_key', 'core.uuidportfolio',
|
|
|
|
'core.uuiditems_uuidportfolio', 'core.uuiditems_uuidportfolio_numericid', 'core.fruit',
|
2011-10-27 11:37:46 +00:00
|
|
|
'core.fruits_uuid_tag', 'core.uuid_tag', 'core.product_update_all', 'core.group_update_all',
|
|
|
|
'core.player', 'core.guild', 'core.guilds_player', 'core.armor', 'core.armors_player',
|
2011-05-24 13:02:45 +00:00
|
|
|
'core.bidding', 'core.bidding_message', 'core.site', 'core.domain', 'core.domains_site',
|
2016-01-21 19:01:48 +00:00
|
|
|
'core.uuidnativeitem', 'core.uuidnativeportfolio', 'core.uuidnativeitems_uuidnativeportfolio',
|
|
|
|
'core.uuidnativeitems_uuidnativeportfolio_numericid',
|
2017-07-05 21:22:58 +00:00
|
|
|
'core.translated_article', 'core.translate_article',
|
2008-05-30 11:40:08 +00:00
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2010-06-01 04:49:11 +00:00
|
|
|
* setUp method
|
2008-06-14 20:39:27 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2022-12-28 07:03:39 +00:00
|
|
|
public function setUp() : void {
|
2010-06-01 04:49:11 +00:00
|
|
|
parent::setUp();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->debug = Configure::read('debug');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2010-06-01 04:49:11 +00:00
|
|
|
* tearDown method
|
2008-06-14 20:39:27 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2022-12-28 07:03:39 +00:00
|
|
|
public function tearDown() : void {
|
2010-06-01 04:49:11 +00:00
|
|
|
parent::tearDown();
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('debug', $this->debug);
|
2009-03-18 17:55:58 +00:00
|
|
|
ClassRegistry::flush();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|