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