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
4 months agoWillis
4 months agoAlex
4 months agoMitsue
5 months agoAlfred
5 months agoTran
5 months agoRashida
5 months agoJesusita
5 months agoLura
5 months agoJacquline
5 months agoMohammad
6 months agoIzetta
6 months agoBeula
6 months agoKarrie
6 months agoBettyann
6 months agoStacey
10 months agoCassie
9 months agoHermila
9 months agoDiego
10 months agoWenona
11 months agoTyisha
10 months agoStephane
10 months agoEvelynn
10 months agoDavida
11 months agoParis
10 months agoLeota
10 months agoFrancesco
11 months agoJose
11 months agoHermila
11 months agoSabra
10 months agoTamar
11 months agoLauna
11 months agoJeannine
11 months agoChuck
11 months agoAlecia
12 months ago