CommentFixture.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Short description for 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.Fixture
  16. * @since CakePHP(tm) v 1.2.0.4667
  17. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  18. */
  19. /**
  20. * Short description for class.
  21. *
  22. * @package Cake.Test.Fixture
  23. */
  24. class CommentFixture extends CakeTestFixture {
  25. /**
  26. * name property
  27. *
  28. * @var string 'Comment'
  29. */
  30. public $name = 'Comment';
  31. /**
  32. * fields property
  33. *
  34. * @var array
  35. */
  36. public $fields = array(
  37. 'id' => array('type' => 'integer', 'key' => 'primary'),
  38. 'article_id' => array('type' => 'integer', 'null' => false),
  39. 'user_id' => array('type' => 'integer', 'null' => false),
  40. 'comment' => 'text',
  41. 'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'),
  42. 'created' => 'datetime',
  43. 'updated' => 'datetime'
  44. );
  45. /**
  46. * records property
  47. *
  48. * @var array
  49. */
  50. public $records = array(
  51. array('article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'),
  52. array('article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
  53. array('article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'),
  54. array('article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'published' => 'N', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'),
  55. array('article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'),
  56. array('article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31')
  57. );
  58. }