ModelTestBase.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * ModelTest file
  4. *
  5. * PHP 5
  6. *
  7. * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
  8. * Copyright 2005-2011, 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-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. * @link http://book.cakephp.org/view/1196/Testing 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.articles', '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. );
  69. /**
  70. * setUp method
  71. *
  72. * @return void
  73. */
  74. public function setUp() {
  75. parent::setUp();
  76. $this->debug = Configure::read('debug');
  77. }
  78. /**
  79. * tearDown method
  80. *
  81. * @return void
  82. */
  83. public function tearDown() {
  84. parent::tearDown();
  85. Configure::write('debug', $this->debug);
  86. ClassRegistry::flush();
  87. }
  88. }