OrdersFixture.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. * @link http://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.7
  13. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\Fixture;
  16. use Cake\TestSuite\Fixture\TestFixture;
  17. /**
  18. * Class OrdersFixture
  19. *
  20. */
  21. class OrdersFixture extends TestFixture
  22. {
  23. /**
  24. * {@inheritDoc}
  25. */
  26. public $table = 'orders';
  27. /**
  28. * fields property
  29. *
  30. * @var array
  31. */
  32. public $fields = [
  33. 'id' => ['type' => 'integer'],
  34. 'product_category' => ['type' => 'integer', 'null' => false],
  35. 'product_id' => ['type' => 'integer', 'null' => false],
  36. '_indexes' => [
  37. 'product_category' => [
  38. 'type' => 'index',
  39. 'columns' => ['product_category', 'product_id']
  40. ]
  41. ],
  42. '_constraints' => [
  43. 'primary' => [
  44. 'type' => 'primary', 'columns' => ['id']
  45. ],
  46. 'product_category_fk' => [
  47. 'type' => 'foreign',
  48. 'columns' => ['product_category', 'product_id'],
  49. 'references' => ['products', ['category', 'id']],
  50. 'update' => 'cascade',
  51. 'delete' => 'cascade',
  52. ]
  53. ]
  54. ];
  55. /**
  56. * records property
  57. *
  58. * @var array
  59. */
  60. public $records = [
  61. ['product_category' => 1, 'product_id' => 1]
  62. ];
  63. }