ModelTestBase.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * ModelTest file
  4. *
  5. * PHP 5
  6. *
  7. * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  8. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  9. *
  10. * Licensed under The MIT License
  11. * For full copyright and license information, please see the LICENSE.txt
  12. * Redistributions of files must retain the above copyright notice
  13. *
  14. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  15. * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
  16. * @package Cake.Test.Case.Model
  17. * @since CakePHP(tm) v 1.2.0.4206
  18. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  19. */
  20. App::uses('Model', 'Model');
  21. App::uses('AppModel', 'Model');
  22. require_once dirname(__FILE__) . DS . 'models.php';
  23. /**
  24. * ModelBaseTest
  25. *
  26. * @package Cake.Test.Case.Model
  27. */
  28. abstract class BaseModelTest extends CakeTestCase {
  29. /**
  30. * autoFixtures property
  31. *
  32. * @var bool false
  33. */
  34. public $autoFixtures = false;
  35. /**
  36. * Whether backup global state for each test method or not
  37. *
  38. * @var bool false
  39. */
  40. public $backupGlobals = false;
  41. /**
  42. * fixtures property
  43. *
  44. * @var array
  45. */
  46. public $fixtures = array(
  47. 'core.category', 'core.category_thread', 'core.user', 'core.my_category', 'core.my_product',
  48. 'core.my_user', 'core.my_categories_my_users', 'core.my_categories_my_products',
  49. 'core.article', 'core.featured', 'core.article_featureds_tags', 'core.article_featured',
  50. 'core.numeric_article', 'core.tag', 'core.articles_tag', 'core.comment',
  51. 'core.attachment', 'core.apple', 'core.sample', 'core.another_article', 'core.item',
  52. 'core.advertisement', 'core.home', 'core.post', 'core.author', 'core.bid', 'core.portfolio',
  53. 'core.product', 'core.project', 'core.thread', 'core.message', 'core.items_portfolio',
  54. 'core.syfile', 'core.image', 'core.device_type', 'core.device_type_category',
  55. 'core.feature_set', 'core.exterior_type_category', 'core.document', 'core.device',
  56. 'core.document_directory', 'core.primary_model', 'core.secondary_model', 'core.something',
  57. 'core.something_else', 'core.join_thing', 'core.join_a', 'core.join_b', 'core.join_c',
  58. 'core.join_a_b', 'core.join_a_c', 'core.uuid', 'core.data_test', 'core.posts_tag',
  59. 'core.the_paper_monkies', 'core.person', 'core.underscore_field', 'core.node',
  60. 'core.dependency', 'core.story', 'core.stories_tag', 'core.cd', 'core.book', 'core.basket',
  61. 'core.overall_favorite', 'core.account', 'core.content', 'core.content_account',
  62. 'core.film_file', 'core.test_plugin_article', 'core.test_plugin_comment', 'core.uuiditem',
  63. 'core.counter_cache_user', 'core.counter_cache_post',
  64. 'core.counter_cache_user_nonstandard_primary_key',
  65. 'core.counter_cache_post_nonstandard_primary_key', 'core.uuidportfolio',
  66. 'core.uuiditems_uuidportfolio', 'core.uuiditems_uuidportfolio_numericid', 'core.fruit',
  67. 'core.fruits_uuid_tag', 'core.uuid_tag', 'core.product_update_all', 'core.group_update_all',
  68. 'core.player', 'core.guild', 'core.guilds_player', 'core.armor', 'core.armors_player',
  69. 'core.bidding', 'core.bidding_message', 'core.site', 'core.domain', 'core.domains_site',
  70. );
  71. /**
  72. * setUp method
  73. *
  74. * @return void
  75. */
  76. public function setUp() {
  77. parent::setUp();
  78. $this->debug = Configure::read('debug');
  79. }
  80. /**
  81. * tearDown method
  82. *
  83. * @return void
  84. */
  85. public function tearDown() {
  86. parent::tearDown();
  87. Configure::write('debug', $this->debug);
  88. ClassRegistry::flush();
  89. }
  90. }