ModelTestBase.php 3.4 KB

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