PageRenderTime 52ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Search/_files/products.php

https://gitlab.com/yousafsyed/easternglamor
PHP | 327 lines | 313 code | 5 blank | 9 comment | 5 complexity | 6b3b28f1ce28b9ec57e3cb45b154deed MD5 | raw file
  1. <?php
  2. /**
  3. * Copyright © 2016 Magento. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /** @var $product \Magento\Catalog\Model\Product */
  7. $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  8. ->create('Magento\Catalog\Model\Product');
  9. $product->isObjectNew(true);
  10. $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
  11. ->setId(1)
  12. ->setAttributeSetId(4)
  13. ->setWebsiteIds([1])
  14. ->setName('Unisex green socks')
  15. ->setSku('green_socks')
  16. ->setPrice(12)
  17. ->setWeight(1)
  18. ->setShortDescription("Unisex green socks for some good peoples at one")
  19. ->setTaxClassId(0)
  20. ->setTierPrice(
  21. [
  22. [
  23. 'website_id' => 0,
  24. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  25. 'price_qty' => 2,
  26. 'price' => 8,
  27. ],
  28. [
  29. 'website_id' => 0,
  30. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  31. 'price_qty' => 5,
  32. 'price' => 5,
  33. ],
  34. [
  35. 'website_id' => 0,
  36. 'cust_group' => \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
  37. 'price_qty' => 3,
  38. 'price' => 5,
  39. ],
  40. ]
  41. )
  42. ->setDescription('Unisex <b>green socks</b> for some good peoples at one')
  43. ->setMetaTitle('green socks metadata')
  44. ->setMetaKeyword('green,socks,unisex')
  45. ->setMetaDescription('green socks metadata description')
  46. ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
  47. ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
  48. ->setCategoryIds([2])
  49. ->setStockData(
  50. [
  51. 'use_config_manage_stock' => 1,
  52. 'qty' => 100,
  53. 'is_qty_decimal' => 0,
  54. 'is_in_stock' => 1,
  55. ]
  56. )
  57. ->setCanSaveCustomOptions(true)
  58. ->setProductOptions(
  59. [
  60. [
  61. 'id' => 1,
  62. 'option_id' => 0,
  63. 'previous_group' => 'text',
  64. 'title' => 'Stone',
  65. 'type' => 'field',
  66. 'is_require' => 1,
  67. 'sort_order' => 0,
  68. 'price' => 1,
  69. 'price_type' => 'fixed',
  70. 'sku' => 'stone-1',
  71. 'max_characters' => 100,
  72. ],
  73. ]
  74. )
  75. ->setHasOptions(true)
  76. ->save();
  77. /** @var $product \Magento\Catalog\Model\Product */
  78. $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  79. ->create('Magento\Catalog\Model\Product');
  80. $product->isObjectNew(true);
  81. $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
  82. ->setId(2)
  83. ->setAttributeSetId(4)
  84. ->setWebsiteIds([1])
  85. ->setName('White shorts')
  86. ->setSku('white_shorts')
  87. ->setPrice(14)
  88. ->setWeight(2)
  89. ->setShortDescription("Small white shorts for your children")
  90. ->setTaxClassId(0)
  91. ->setTierPrice(
  92. [
  93. [
  94. 'website_id' => 0,
  95. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  96. 'price_qty' => 2,
  97. 'price' => 8,
  98. ],
  99. [
  100. 'website_id' => 0,
  101. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  102. 'price_qty' => 5,
  103. 'price' => 5,
  104. ],
  105. [
  106. 'website_id' => 0,
  107. 'cust_group' => \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
  108. 'price_qty' => 3,
  109. 'price' => 5,
  110. ],
  111. ]
  112. )
  113. ->setDescription('Small <b>white shorts</b> for your children')
  114. ->setMetaTitle('white shorts for your children metadata')
  115. ->setMetaKeyword('white,shorts,children')
  116. ->setMetaDescription('white shorts for your children metadata description')
  117. ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
  118. ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
  119. ->setCategoryIds([2])
  120. ->setStockData(
  121. [
  122. 'use_config_manage_stock' => 1,
  123. 'qty' => 100,
  124. 'is_qty_decimal' => 0,
  125. 'is_in_stock' => 1,
  126. ]
  127. )
  128. ->setCanSaveCustomOptions(true)
  129. ->setProductOptions(
  130. [
  131. [
  132. 'id' => 2,
  133. 'option_id' => 0,
  134. 'previous_group' => 'text',
  135. 'title' => 'Gold',
  136. 'type' => 'field',
  137. 'is_require' => 1,
  138. 'sort_order' => 0,
  139. 'price' => 1,
  140. 'price_type' => 'fixed',
  141. 'sku' => 'Gold',
  142. 'max_characters' => 100,
  143. ],
  144. ]
  145. )
  146. ->setHasOptions(true)
  147. ->save();
  148. /** @var $product \Magento\Catalog\Model\Product */
  149. $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  150. ->create('Magento\Catalog\Model\Product');
  151. $product->isObjectNew(true);
  152. $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
  153. ->setId(3)
  154. ->setAttributeSetId(4)
  155. ->setWebsiteIds([1])
  156. ->setName('Red trousers')
  157. ->setSku('red_trousers')
  158. ->setPrice(16)
  159. ->setWeight(3)
  160. ->setShortDescription("Red pants for men")
  161. ->setTaxClassId(0)
  162. ->setTierPrice(
  163. [
  164. [
  165. 'website_id' => 0,
  166. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  167. 'price_qty' => 2,
  168. 'price' => 8,
  169. ],
  170. [
  171. 'website_id' => 0,
  172. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  173. 'price_qty' => 5,
  174. 'price' => 5,
  175. ],
  176. [
  177. 'website_id' => 0,
  178. 'cust_group' => \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
  179. 'price_qty' => 3,
  180. 'price' => 5,
  181. ],
  182. ]
  183. )
  184. ->setDescription('Red pants for <b>men</b>')
  185. ->setMetaTitle('Red trousers meta title')
  186. ->setMetaKeyword('red,trousers,meta,men')
  187. ->setMetaDescription('Red trousers meta description')
  188. ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
  189. ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
  190. ->setCategoryIds([2])
  191. ->setStockData(
  192. [
  193. 'use_config_manage_stock' => 1,
  194. 'qty' => 100,
  195. 'is_qty_decimal' => 0,
  196. 'is_in_stock' => 1,
  197. ]
  198. )
  199. ->setCanSaveCustomOptions(true)
  200. ->setProductOptions(
  201. [
  202. [
  203. 'id' => 3,
  204. 'option_id' => 0,
  205. 'previous_group' => 'text',
  206. 'title' => 'Silver',
  207. 'type' => 'field',
  208. 'is_require' => 1,
  209. 'sort_order' => 0,
  210. 'price' => 1,
  211. 'price_type' => 'fixed',
  212. 'sku' => 'silver',
  213. 'max_characters' => 100,
  214. ],
  215. ]
  216. )
  217. ->setHasOptions(true)
  218. ->save();
  219. /** @var $product \Magento\Catalog\Model\Product */
  220. $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  221. ->create('Magento\Catalog\Model\Product');
  222. $product->isObjectNew(true);
  223. $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
  224. ->setId(4)
  225. ->setAttributeSetId(4)
  226. ->setWebsiteIds([1])
  227. ->setName('Blue briefs')
  228. ->setSku('blue_briefs')
  229. ->setPrice(18)
  230. ->setWeight(3)
  231. ->setShortDescription("Blue briefs for Russian men")
  232. ->setTaxClassId(0)
  233. ->setTierPrice(
  234. [
  235. [
  236. 'website_id' => 0,
  237. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  238. 'price_qty' => 2,
  239. 'price' => 8,
  240. ],
  241. [
  242. 'website_id' => 0,
  243. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  244. 'price_qty' => 5,
  245. 'price' => 5,
  246. ],
  247. [
  248. 'website_id' => 0,
  249. 'cust_group' => \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
  250. 'price_qty' => 3,
  251. 'price' => 5,
  252. ],
  253. ]
  254. )
  255. ->setDescription('Blue briefs for <b>men</b>')
  256. ->setMetaTitle('Blue briefs meta title')
  257. ->setMetaKeyword('blue,briefs,meta,men')
  258. ->setMetaDescription('Blue briefs meta description')
  259. ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
  260. ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
  261. ->setCategoryIds([2])
  262. ->setStockData(
  263. [
  264. 'use_config_manage_stock' => 1,
  265. 'qty' => 100,
  266. 'is_qty_decimal' => 0,
  267. 'is_in_stock' => 1,
  268. ]
  269. )
  270. ->save();
  271. /** @var $product \Magento\Catalog\Model\Product */
  272. $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  273. ->create('Magento\Catalog\Model\Product');
  274. $product->isObjectNew(true);
  275. $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)
  276. ->setId(5)
  277. ->setAttributeSetId(4)
  278. ->setWebsiteIds([1])
  279. ->setName('Grey shorts')
  280. ->setSku('grey_shorts')
  281. ->setPrice(20)
  282. ->setWeight(3)
  283. ->setShortDescription("Grey or green shorts for all peoples at one")
  284. ->setTaxClassId(0)
  285. ->setTierPrice(
  286. [
  287. [
  288. 'website_id' => 0,
  289. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  290. 'price_qty' => 2,
  291. 'price' => 8,
  292. ],
  293. [
  294. 'website_id' => 0,
  295. 'cust_group' => \Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL,
  296. 'price_qty' => 5,
  297. 'price' => 5,
  298. ],
  299. [
  300. 'website_id' => 0,
  301. 'cust_group' => \Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID,
  302. 'price_qty' => 3,
  303. 'price' => 5,
  304. ],
  305. ]
  306. )
  307. ->setDescription('Grey or green shorts for peoples at <b>one</b>')
  308. ->setMetaTitle('Grey shorts meta title')
  309. ->setMetaKeyword('grey,shorts,meta,men')
  310. ->setMetaDescription('Grey shorts meta description')
  311. ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
  312. ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
  313. ->setCategoryIds([2])
  314. ->setStockData(
  315. [
  316. 'use_config_manage_stock' => 1,
  317. 'qty' => 100,
  318. 'is_qty_decimal' => 0,
  319. 'is_in_stock' => 1,
  320. ]
  321. )
  322. ->save();