Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
different_reviews.php
Go to the documentation of this file.
1 <?php
7 require __DIR__ . '/../../../Magento/Catalog/_files/product_simple.php';
8 
10  \Magento\Review\Model\Review::class,
11  ['data' => ['nickname' => 'Nickname', 'title' => 'Review Summary', 'detail' => 'Review text']]
12 );
13 $review->setEntityId(
14  $review->getEntityIdByCode(\Magento\Review\Model\Review::ENTITY_PRODUCT_CODE)
15 )->setEntityPkValue(
16  1
17 )->setStatusId(
18  \Magento\Review\Model\Review::STATUS_PENDING
19 )->setStoreId(
20  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
21  \Magento\Store\Model\StoreManagerInterface::class
22  )->getStore()->getId()
23 )->setStores(
24  [
25  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
26  \Magento\Store\Model\StoreManagerInterface::class
27  )->getStore()->getId()
28  ]
29 )->save();
30 
32  \Magento\Review\Model\Review::class,
33  ['data' => ['nickname' => 'Nickname', 'title' => '2 filter first review', 'detail' => 'Review text']]
34 );
35 $review->setEntityId(
36  $review->getEntityIdByCode(\Magento\Review\Model\Review::ENTITY_PRODUCT_CODE)
37 )->setEntityPkValue(
38  1
39 )->setStatusId(
40  \Magento\Review\Model\Review::STATUS_APPROVED
41 )->setStoreId(
42  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
43  \Magento\Store\Model\StoreManagerInterface::class
44  )->getStore()->getId()
45 )->setStores(
46  [
47  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
48  \Magento\Store\Model\StoreManagerInterface::class
49  )->getStore()->getId()
50  ]
51 )->save();
52 
54  \Magento\Review\Model\Review::class,
55  ['data' => ['nickname' => 'Nickname', 'title' => '1 filter second review', 'detail' => 'Review text']]
56 );
57 $review->setEntityId(
58  $review->getEntityIdByCode(\Magento\Review\Model\Review::ENTITY_PRODUCT_CODE)
59 )->setEntityPkValue(
60  1
61 )->setStatusId(
62  \Magento\Review\Model\Review::STATUS_APPROVED
63 )->setStoreId(
64  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
65  \Magento\Store\Model\StoreManagerInterface::class
66  )->getStore()->getId()
67 )->setStores(
68  [
69  \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
70  \Magento\Store\Model\StoreManagerInterface::class
71  )->getStore()->getId()
72  ]
73 )->save();
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60