PersonFixture.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Short description for file.
  4. *
  5. * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
  14. * @since 1.2.0
  15. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  16. */
  17. namespace Cake\Test\Fixture;
  18. use Cake\TestSuite\Fixture\TestFixture;
  19. /**
  20. * Class PersonFixture
  21. *
  22. */
  23. class PersonFixture extends TestFixture {
  24. /**
  25. * fields property
  26. *
  27. * @var array
  28. */
  29. public $fields = array(
  30. 'id' => ['type' => 'integer', 'null' => false],
  31. 'name' => ['type' => 'string', 'null' => false, 'length' => 32],
  32. 'mother_id' => ['type' => 'integer', 'null' => false],
  33. 'father_id' => ['type' => 'integer', 'null' => false],
  34. '_constraints' => [
  35. 'primary' => ['type' => 'primary', 'columns' => ['id']],
  36. 'mother_idx' => ['type' => 'unique', 'columns' => ['mother_id', 'father_id']]
  37. ]
  38. );
  39. /**
  40. * records property
  41. *
  42. * @var array
  43. */
  44. public $records = array(
  45. array('name' => 'person', 'mother_id' => 2, 'father_id' => 3),
  46. array('name' => 'mother', 'mother_id' => 4, 'father_id' => 5),
  47. array('name' => 'father', 'mother_id' => 6, 'father_id' => 7),
  48. array('name' => 'mother - grand mother', 'mother_id' => 0, 'father_id' => 0),
  49. array('name' => 'mother - grand father', 'mother_id' => 0, 'father_id' => 0),
  50. array('name' => 'father - grand mother', 'mother_id' => 0, 'father_id' => 0),
  51. array('name' => 'father - grand father', 'mother_id' => 0, 'father_id' => 0)
  52. );
  53. }