Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
GroupedProduct
Model
ResourceModel
Product
Type
Grouped
AssociatedProductsCollectionTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\GroupedProduct\Model\ResourceModel\Product\Type\Grouped
;
7
8
class
AssociatedProductsCollectionTest
extends
\PHPUnit\Framework\TestCase
9
{
15
public
function
testGetColumnValues()
16
{
17
$productRepository
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
18
->get(\
Magento
\Catalog\Api\ProductRepositoryInterface::class);
20
$product
=
$productRepository
->get(
'grouped-product'
);
21
23
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
24
$objectManager
->get(\
Magento
\Framework\Registry::class)->register(
'current_product'
,
$product
);
25
26
$collection
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
27
\
Magento
\GroupedProduct\Model\
ResourceModel
\Product\Type\Grouped\AssociatedProductsCollection::class
28
);
29
30
$resultData =
$collection
->getColumnValues(
'sku'
);
31
$this->assertNotEmpty($resultData);
32
33
$expected = [
'virtual-product'
,
'simple'
];
34
sort($expected);
35
sort($resultData);
36
$this->assertEquals($expected, $resultData);
37
}
38
}
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$objectManager
$objectManager
Definition:
bootstrap.php:17
$productRepository
$productRepository
Definition:
bundle_product_with_not_visible_children.php:18
Magento\GroupedProduct\Model\ResourceModel\Product\Type\Grouped\AssociatedProductsCollectionTest
Definition:
AssociatedProductsCollectionTest.php:8
Magento
Magento\GroupedProduct\Model\ResourceModel\Product\Type\Grouped
Definition:
AssociatedProductsCollectionTest.php:6
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125