New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E722 Exam - Topic 4 Question 13 Discussion

Actual exam question for Adobe's AD0-E722 exam
Question #: 13
Topic #: 4
[All AD0-E722 Questions]

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.)

Show Suggested Answer Hide Answer
Suggested Answer: C

To create an integration test that executes different logic in different store views, the Architect needs to do the following steps:

Create one test class that extends MagentoTestFrameworkTestCaseAbstractController or MagentoTestFrameworkTestCaseAbstractBackendController, depending on the type of controller being tested1.

Create one test method that uses the @magentoDataFixture annotation to specify the data fixture file that creates the product2.

Use the MagentoTestFrameworkStoreExecuteInStoreContext class to execute the fixture and the tested logic in different store views. This class has a method called executeInStoreContext, which takes two parameters: the store ID and a callable function.The callable function will be executed in the context of the given store ID, and then the original store ID will be restored3. For example:

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

Contribute your Thoughts:

0/2000 characters
Ressie
3 months ago
Surprised that E is an option, isn't that overkill for just reading XML?
upvoted 0 times
...
Rosendo
3 months ago
Wait, can you really just append the file name like that?
upvoted 0 times
...
Willis
3 months ago
Definitely A, but D sounds a bit off.
upvoted 0 times
...
Alex
4 months ago
I think B could work too, but not sure if it's the best approach.
upvoted 0 times
...
Mitsue
4 months ago
A and E seem like the right steps to me.
upvoted 0 times
...
Alfred
4 months ago
I'm leaning towards appending the custom XML file name in di.xml, but I need to double-check if that's the right approach.
upvoted 0 times
...
Tran
4 months ago
I feel like writing a plugin for \Magento\Framework\Config\Data::get() could be a good option, but I can't recall the details.
upvoted 0 times
...
Rashida
4 months ago
I remember practicing a question about merging XML files, and I think creating a Reader class might be involved.
upvoted 0 times
...
Jesusita
5 months ago
I think we need to inject a 'reader' dependency in di.xml, but I'm not entirely sure if that's the only step.
upvoted 0 times
...
Lura
5 months ago
Okay, I think I've got a strategy here. I'll focus on the key requirements - reading all the XML config files, merging them, and using the values in a PHP class. Options A and E seem like the right steps to take.
upvoted 0 times
...
Jacquline
5 months ago
Hmm, I'm a bit confused by the wording of the question. I'll need to re-read it a few times to make sure I understand exactly what's being asked.
upvoted 0 times
...
Mohammad
5 months ago
This looks like a tricky one. I'll need to carefully review the options and think through the steps required to meet the requirements.
upvoted 0 times
...
Izetta
5 months ago
I'm feeling pretty confident about this one. The question is straightforward, and the steps to solve it are clear to me. I'll go with options B and C.
upvoted 0 times
...
Beula
5 months ago
Okay, let me think this through. The question specifically mentions that the storage account is configured to use the customer-managed keys, so that narrows it down to the storage-related services. I'll go with Azure Files and Blob storage as my answers.
upvoted 0 times
...
Karrie
5 months ago
I'm pretty confident I know the answer to this one. Trace flags are used for Apex, Visualforce, and Process Builder, right?
upvoted 0 times
...
Bettyann
5 months ago
Okay, this seems straightforward. I just need to count the number of Multimedia users in the sample data provided. I'll go through the options and see which one matches the correct number.
upvoted 0 times
...
Stacey
10 months ago
This is a tough one, but I reckon the answer is A and E. The way I see it, you need to be able to read and merge those custom XML files, and a custom Reader class is the way to do it. Anything else would just be a half-baked solution, and we all know how well those go down in the real world!
upvoted 0 times
Cassie
8 months ago
Yeah, A and E make the most sense. We can't afford a half-baked solution for this.
upvoted 0 times
...
Hermila
9 months ago
I agree, A and E seem like the best options. We definitely need a way to read and merge those files.
upvoted 0 times
...
Diego
9 months ago
I think A and E are the way to go. You need a custom Reader class to handle those XML files.
upvoted 0 times
...
...
Wenona
10 months ago
D doesn't seem like the right approach. Appending the custom XML file name in Magento\\Config\\Model\\Config\\Structure\\Reader won't solve the problem of reading and merging the custom XML files.
upvoted 0 times
Tyisha
9 months ago
That makes sense, we need to inject the reader dependency and create a custom Reader class for handling the XML files.
upvoted 0 times
...
Stephane
9 months ago
E) Make a Reader class that implements '\\Magento\\Framework\\Config\\Reader\\Filesystem'
upvoted 0 times
...
Evelynn
10 months ago
A) Inject a 'reader' dependency for 'Magento\\Framework\\Config\\Data' in di.xml
upvoted 0 times
...
...
Davida
10 months ago
C seems like a good approach, but I'm not sure if it's the complete solution. I think we also need to handle the reading and merging of the custom XML files, so A and E are probably the way to go.
upvoted 0 times
Paris
9 months ago
Yes, those two steps should allow the module to read and merge the custom XML files as needed.
upvoted 0 times
...
Leota
9 months ago
I agree, A and E seem like the right steps to take in order to meet the requirement.
upvoted 0 times
...
Francesco
10 months ago
E) Make a Reader class that implements '\\Magento\\Framework\\Config\\Reader\\Filesystem'
upvoted 0 times
...
Jose
10 months ago
A) Inject a 'reader' dependency for 'Magento\\Framework\\Config\\Data' in di.xml
upvoted 0 times
...
...
Hermila
10 months ago
Hmm, I'm not sure about B. Modifying the get() method of Magento\\Framework\\Config\\Data seems like a bad idea, and might break other functionality. I'd go with A and E.
upvoted 0 times
Sabra
9 months ago
Yeah, I think A and E would be the better choices. It's important to avoid breaking existing functionality.
upvoted 0 times
...
Tamar
10 months ago
I agree, modifying the get() method could cause issues. Injecting a 'reader' dependency and creating a Reader class seems like a safer approach.
upvoted 0 times
...
...
Launa
10 months ago
I think the answer is A and E. We need to inject a reader dependency for Magento\\Framework\\Config\\Data, and create a custom Reader class that implements Magento\\Framework\\Config\\Reader\\Filesystem to read the custom XML files.
upvoted 0 times
...
Jeannine
10 months ago
I believe creating a Data class that implements '\Magento\Framework\Config\Data' is also crucial for merging and using the values in PHP class.
upvoted 0 times
...
Chuck
11 months ago
I agree with Alecia. It's important to have the correct dependency injection for reading the xml configuration files.
upvoted 0 times
...
Alecia
11 months ago
I think the Architect should inject a 'reader' dependency for 'Magento\Framework\Config\Data' in di.xml.
upvoted 0 times
...

Save Cancel