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
module-inventory-catalog
Test
Integration
CatalogInventory
Model
ResourceModel
Stock
Status
AddStockDataToCollectionOnDefaultStockTest.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status
;
9
10
use
Magento\Catalog\Model\ResourceModel\Product\Collection
;
11
use
Magento\CatalogInventory\Model\ResourceModel\Stock\Status
as
StockStatus
;
12
use
Magento\TestFramework\Helper\Bootstrap
;
13
use PHPUnit\Framework\TestCase;
14
15
class
AddStockDataToCollectionOnDefaultStockTest
extends
TestCase
16
{
20
private
$stockStatus;
21
25
protected
function
setUp
()
26
{
27
parent::setUp();
28
29
$this->stockStatus =
Bootstrap::getObjectManager
()->create(StockStatus::class);
30
}
31
42
public
function
testAddStockDataToCollection
(
int
$expectedSize,
bool
$isFilterInStock)
43
{
44
$collection
=
Bootstrap::getObjectManager
()->create(Collection::class);
45
$collection
= $this->stockStatus->addStockDataToCollection(
$collection
, $isFilterInStock);
46
47
self::assertEquals($expectedSize,
$collection
->getSize());
48
}
49
53
public
function
addStockDataToCollectionDataProvider
(): array
54
{
55
return
[
56
[3,
true
],
57
[5,
false
],
58
];
59
}
60
}
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status\AddStockDataToCollectionOnDefaultStockTest
Definition:
AddStockDataToCollectionOnDefaultStockTest.php:15
Magento\CatalogInventory\Model\ResourceModel\Stock\Status
Definition:
Collection.php:7
Magento\Catalog\Model\ResourceModel\Product\Collection
Definition:
ProductLimitation.php:6
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status\AddStockDataToCollectionOnDefaultStockTest\addStockDataToCollectionDataProvider
addStockDataToCollectionDataProvider()
Definition:
AddStockDataToCollectionOnDefaultStockTest.php:53
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status\AddStockDataToCollectionOnDefaultStockTest\testAddStockDataToCollection
testAddStockDataToCollection(int $expectedSize, bool $isFilterInStock)
Definition:
AddStockDataToCollectionOnDefaultStockTest.php:42
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status
Definition:
AddIsInStockFilterToCollectionOnDefaultStockTest.php:8
Magento\InventoryCatalog\Test\Integration\CatalogInventory\Model\ResourceModel\Stock\Status\AddStockDataToCollectionOnDefaultStockTest\setUp
setUp()
Definition:
AddStockDataToCollectionOnDefaultStockTest.php:25
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125