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
functional
tests
app
Magento
PageCache
Test
TestCase
CacheInvalidationTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\PageCache\Test\TestCase
;
8
9
use Magento\Mtf\TestCase\Injectable;
10
use
Magento\Catalog\Test\Fixture\CatalogProductSimple
;
11
use
Magento\Store\Test\Fixture\Store
;
12
use Magento\Mtf\Client\BrowserInterface;
13
use Magento\Mtf\Fixture\FixtureFactory;
14
use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
15
29
class
CacheInvalidationTest
extends
Injectable
30
{
31
/* tags */
32
const
MVP
=
'no'
;
33
/* end tags */
34
40
private
$browser;
41
47
private
$fixtureFactory;
48
54
private
$editProductPage;
55
64
public
function
__inject
(
65
BrowserInterface $browser,
66
FixtureFactory $fixtureFactory,
67
CatalogProductEdit $editProductPage
68
) {
69
$this->browser = $browser;
70
$this->fixtureFactory = $fixtureFactory;
71
$this->editProductPage = $editProductPage;
72
}
73
81
public
function
test
(
82
CatalogProductSimple
$product
,
83
Store
$store
84
) {
85
//Preconditions:
86
$product
->persist();
87
$store
->persist();
88
89
//Steps
90
$category
=
$product
->getDataFieldConfig(
'category_ids'
)[
'source'
]->getCategories()[0];
91
$storeGroup
=
$store
->getDataFieldConfig(
'group_id'
)[
'source'
]->getStoreGroup();
92
$website
=
$storeGroup
->getDataFieldConfig(
'website_id'
)[
'source'
]->getWebsite();
93
$url
= $_ENV[
'app_frontend_url'
] .
'websites/'
.
$website
->getCode() .
'/'
.
$category
->getUrlKey() .
'.html'
;
94
$this->browser->open(
$url
);
95
$this->browser->open(
$url
);
96
97
$productFixture = $this->fixtureFactory->createByCode(
98
'catalogProductSimple'
,
99
[
'data'
=> [
'website_ids'
=> [[
'store'
=>
$store
]]]]
100
);
101
$this->editProductPage->open([
'id'
=>
$product
->getId()]);
102
$this->editProductPage->getProductForm()->fill($productFixture);
103
$this->editProductPage->getFormPageActions()->save();
104
105
return
[
106
'category'
=>
$category
,
107
];
108
}
109
}
$category
$category
Definition:
catalog_category_with_slash.php:7
$storeGroup
$storeGroup
Definition:
website_attribute_sync.php:59
Magento\PageCache\Test\TestCase\CacheInvalidationTest\test
test(CatalogProductSimple $product, Store $store)
Definition:
CacheInvalidationTest.php:81
$url
$url
Definition:
query_redirect.php:14
Magento\PageCache\Test\TestCase\CacheInvalidationTest\MVP
const MVP
Definition:
CacheInvalidationTest.php:32
$website
$website
Definition:
payment_configuration_rollback.php:38
Magento\PageCache\Test\TestCase
Definition:
CacheInvalidationTest.php:7
Magento\Store\Test\Fixture\Store
Definition:
GroupId.php:7
Magento\PageCache\Test\TestCase\CacheInvalidationTest\__inject
__inject(BrowserInterface $browser, FixtureFactory $fixtureFactory, CatalogProductEdit $editProductPage)
Definition:
CacheInvalidationTest.php:64
Magento\Catalog\Test\Fixture\CatalogProductSimple
Definition:
CustomAttribute.php:7
Magento\PageCache\Test\TestCase\CacheInvalidationTest
Definition:
CacheInvalidationTest.php:29
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$store
$store
Definition:
payment_configuration_rollback.php:33