In a custom module, an Architect wants to define a new xml configuration file. The module should be able to read all the xml configuration files declared in the system, merge them together, and use their values in PHP class.
Which two steps should the Architect make to meet this requirement? (Choose two.)
To create an integration test that executes different logic in different store views, the Architect needs to do the following steps:
PHPAI-generated code. Review and use carefully.More info on FAQ.
public function testSomeLogic()
{
// Get the product from the fixture
$product = $this->getProduct();
// Get the ExecuteInStoreContext instance from the object manager
$executeInStoreContext = $this->_objectManager->get(MagentoTestFrameworkStoreExecuteInStoreContext::class);
// Execute the fixture in store view 3
$executeInStoreContext->executeInStoreContext(3, function () use ($product) {
// Do some operations on the product in store view 3
});
// Execute the tested logic in store view 4
$result = $executeInStoreContext->executeInStoreContext(4, function () use ($product) {
// Call the tested logic on the product in store view 4
return $this->someLogic->execute($product);
});
// Assert that the result is true
$this->assertTrue($result);
}
Integration tests | Magento 2 Developer Documentation
Data fixtures | Magento 2 Developer Documentation
MagentoTestFrameworkStoreExecuteInStoreContext | Magento 2 Developer Documentation
Ressie
4 months agoRosendo
5 months agoWillis
5 months agoAlex
5 months agoMitsue
5 months agoAlfred
6 months agoTran
6 months agoRashida
6 months agoJesusita
6 months agoLura
6 months agoJacquline
6 months agoMohammad
6 months agoIzetta
6 months agoBeula
6 months agoKarrie
6 months agoBettyann
7 months agoStacey
11 months agoCassie
10 months agoHermila
10 months agoDiego
10 months agoWenona
12 months agoTyisha
11 months agoStephane
11 months agoEvelynn
11 months agoDavida
12 months agoParis
11 months agoLeota
11 months agoFrancesco
11 months agoJose
11 months agoHermila
12 months agoSabra
11 months agoTamar
11 months agoLauna
12 months agoJeannine
12 months agoChuck
1 year agoAlecia
1 year ago