MenuLinkTreesFixture.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://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. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\Fixture;
  16. use Cake\TestSuite\Fixture\TestFixture;
  17. /**
  18. * NumberTreeFixture
  19. *
  20. * Generates a tree of data for use testing the tree behavior
  21. */
  22. class MenuLinkTreesFixture extends TestFixture
  23. {
  24. /**
  25. * Records
  26. *
  27. * # main-menu:
  28. *
  29. * - Link 1:1
  30. * - Link 2:2
  31. * - Link 3:3
  32. * - Link 4:4
  33. * - Link 5:5
  34. * - Link 6:6
  35. * - Link 7:7
  36. * - Link 8:8
  37. *
  38. * ***
  39. *
  40. * # categories:
  41. *
  42. * - electronics:9
  43. * - televisions:10
  44. * - tube:11
  45. * - lcd:12
  46. * - plasma:13
  47. * - portable:14
  48. * - mp3:15
  49. * - flash:16
  50. * - cd:17
  51. * - radios:18
  52. *
  53. * **Note:** title:id
  54. */
  55. public array $records = [
  56. [
  57. 'menu' => 'main-menu',
  58. 'lft' => '1',
  59. 'rght' => '10',
  60. 'parent_id' => null,
  61. 'url' => '/link1.html',
  62. 'title' => 'Link 1',
  63. ],
  64. [
  65. 'menu' => 'main-menu',
  66. 'lft' => '2',
  67. 'rght' => '3',
  68. 'parent_id' => '1',
  69. 'url' => 'http://example.com',
  70. 'title' => 'Link 2',
  71. ],
  72. [
  73. 'menu' => 'main-menu',
  74. 'lft' => '4',
  75. 'rght' => '9',
  76. 'parent_id' => '1',
  77. 'url' => '/what/even-more-links.html',
  78. 'title' => 'Link 3',
  79. ],
  80. [
  81. 'menu' => 'main-menu',
  82. 'lft' => '5',
  83. 'rght' => '8',
  84. 'parent_id' => '3',
  85. 'url' => '/lorem/ipsum.html',
  86. 'title' => 'Link 4',
  87. ],
  88. [
  89. 'menu' => 'main-menu',
  90. 'lft' => '6',
  91. 'rght' => '7',
  92. 'parent_id' => '4',
  93. 'url' => '/what/the.html',
  94. 'title' => 'Link 5',
  95. ],
  96. [
  97. 'menu' => 'main-menu',
  98. 'lft' => '11',
  99. 'rght' => '14',
  100. 'parent_id' => null,
  101. 'url' => '/yeah/another-link.html',
  102. 'title' => 'Link 6',
  103. ],
  104. [
  105. 'menu' => 'main-menu',
  106. 'lft' => '12',
  107. 'rght' => '13',
  108. 'parent_id' => '6',
  109. 'url' => 'https://cakephp.org',
  110. 'title' => 'Link 7',
  111. ],
  112. [
  113. 'menu' => 'main-menu',
  114. 'lft' => '15',
  115. 'rght' => '16',
  116. 'parent_id' => null,
  117. 'url' => '/page/who-we-are.html',
  118. 'title' => 'Link 8',
  119. ],
  120. [
  121. 'menu' => 'categories',
  122. 'lft' => '1',
  123. 'rght' => '10',
  124. 'parent_id' => null,
  125. 'url' => '/cagetory/electronics.html',
  126. 'title' => 'electronics',
  127. ],
  128. [
  129. 'menu' => 'categories',
  130. 'lft' => '2',
  131. 'rght' => '9',
  132. 'parent_id' => '9',
  133. 'url' => '/category/televisions.html',
  134. 'title' => 'televisions',
  135. ],
  136. [
  137. 'menu' => 'categories',
  138. 'lft' => '3',
  139. 'rght' => '4',
  140. 'parent_id' => '10',
  141. 'url' => '/category/tube.html',
  142. 'title' => 'tube',
  143. ],
  144. [
  145. 'menu' => 'categories',
  146. 'lft' => '5',
  147. 'rght' => '8',
  148. 'parent_id' => '10',
  149. 'url' => '/category/lcd.html',
  150. 'title' => 'lcd',
  151. ],
  152. [
  153. 'menu' => 'categories',
  154. 'lft' => '6',
  155. 'rght' => '7',
  156. 'parent_id' => '12',
  157. 'url' => '/category/plasma.html',
  158. 'title' => 'plasma',
  159. ],
  160. [
  161. 'menu' => 'categories',
  162. 'lft' => '11',
  163. 'rght' => '20',
  164. 'parent_id' => null,
  165. 'url' => '/category/portable.html',
  166. 'title' => 'portable',
  167. ],
  168. [
  169. 'menu' => 'categories',
  170. 'lft' => '12',
  171. 'rght' => '15',
  172. 'parent_id' => '14',
  173. 'url' => '/category/mp3.html',
  174. 'title' => 'mp3',
  175. ],
  176. [
  177. 'menu' => 'categories',
  178. 'lft' => '13',
  179. 'rght' => '14',
  180. 'parent_id' => '15',
  181. 'url' => '/category/flash.html',
  182. 'title' => 'flash',
  183. ],
  184. [
  185. 'menu' => 'categories',
  186. 'lft' => '16',
  187. 'rght' => '17',
  188. 'parent_id' => '14',
  189. 'url' => '/category/cd.html',
  190. 'title' => 'cd',
  191. ],
  192. [
  193. 'menu' => 'categories',
  194. 'lft' => '18',
  195. 'rght' => '19',
  196. 'parent_id' => '14',
  197. 'url' => '/category/radios.html',
  198. 'title' => 'radios',
  199. ],
  200. ];
  201. }