reviews.php 991 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. require __DIR__ . '/../../../Magento/Catalog/_files/multiple_products.php';
  7. $review = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  8. \Magento\Review\Model\Review::class,
  9. ['data' => ['nickname' => 'Nickname', 'title' => 'Review Summary', 'detail' => 'Review text']]
  10. );
  11. $review->setEntityId(
  12. $review->getEntityIdByCode(\Magento\Review\Model\Review::ENTITY_PRODUCT_CODE)
  13. )->setEntityPkValue(
  14. $product->getId()
  15. )->setStatusId(
  16. \Magento\Review\Model\Review::STATUS_PENDING
  17. )->setStoreId(
  18. \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  19. \Magento\Store\Model\StoreManagerInterface::class
  20. )->getStore()->getId()
  21. )->setStores(
  22. [
  23. \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  24. \Magento\Store\Model\StoreManagerInterface::class
  25. )->getStore()->getId()
  26. ]
  27. )->save();