ModelTestBase.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.tests.cases.libs.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. PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
  23. /**
  24. * ModelBaseTest
  25. *
  26. * @package cake.tests.cases.libs.model
  27. */
  28. abstract class BaseModelTest extends CakeTestCase {
  29. /**
  30. * autoFixtures property
  31. *
  32. * @var bool false
  33. * @access public
  34. */
  35. public $autoFixtures = false;
  36. /**
  37. * Whether backup global state for each test method or not
  38. *
  39. * @var bool false
  40. * @access public
  41. */
  42. public $backupGlobals = false;
  43. /**
  44. * fixtures property
  45. *
  46. * @var array
  47. * @access public
  48. */
  49. public $fixtures = array(
  50. 'core.category', 'core.category_thread', 'core.user', 'core.my_category', 'core.my_product',
  51. 'core.my_user', 'core.my_categories_my_users', 'core.my_categories_my_products',
  52. 'core.article', 'core.featured', 'core.article_featureds_tags', 'core.article_featured',
  53. 'core.articles', 'core.numeric_article', 'core.tag', 'core.articles_tag', 'core.comment',
  54. 'core.attachment', 'core.apple', 'core.sample', 'core.another_article', 'core.item',
  55. 'core.advertisement', 'core.home', 'core.post', 'core.author', 'core.bid', 'core.portfolio',
  56. 'core.product', 'core.project', 'core.thread', 'core.message', 'core.items_portfolio',
  57. 'core.syfile', 'core.image', 'core.device_type', 'core.device_type_category',
  58. 'core.feature_set', 'core.exterior_type_category', 'core.document', 'core.device',
  59. 'core.document_directory', 'core.primary_model', 'core.secondary_model', 'core.something',
  60. 'core.something_else', 'core.join_thing', 'core.join_a', 'core.join_b', 'core.join_c',
  61. 'core.join_a_b', 'core.join_a_c', 'core.uuid', 'core.data_test', 'core.posts_tag',
  62. 'core.the_paper_monkies', 'core.person', 'core.underscore_field', 'core.node',
  63. 'core.dependency', 'core.story', 'core.stories_tag', 'core.cd', 'core.book', 'core.basket',
  64. 'core.overall_favorite', 'core.account', 'core.content', 'core.content_account',
  65. 'core.film_file', 'core.test_plugin_article', 'core.test_plugin_comment', 'core.uuiditem',
  66. 'core.counter_cache_user', 'core.counter_cache_post',
  67. 'core.counter_cache_user_nonstandard_primary_key',
  68. 'core.counter_cache_post_nonstandard_primary_key', 'core.uuidportfolio',
  69. 'core.uuiditems_uuidportfolio', 'core.uuiditems_uuidportfolio_numericid', 'core.fruit',
  70. 'core.fruits_uuid_tag', 'core.uuid_tag', 'core.product_update_all', 'core.group_update_all'
  71. );
  72. /**
  73. * setUp method
  74. *
  75. * @access public
  76. * @return void
  77. */
  78. public function setUp() {
  79. parent::setUp();
  80. $this->debug = Configure::read('debug');
  81. }
  82. /**
  83. * tearDown method
  84. *
  85. * @access public
  86. * @return void
  87. */
  88. public function tearDown() {
  89. parent::tearDown();
  90. Configure::write('debug', $this->debug);
  91. ClassRegistry::flush();
  92. }
  93. }