今すぐAD0-E722問題を使おうAD0-E722問題集PDF [Q30-Q53]

Share

今すぐAD0-E722問題を使おうAD0-E722問題集PDF

問題集練習試験問題学習ガイドはAD0-E722試験合格させます


Adobe AD0-E722 認定試験の出題範囲:

トピック出題範囲
トピック 1
  • Oversee and improve deployment process
  • Integrate Adobe Commerce with external systems and services
トピック 2
  • Design and implement optimal solutions for Adobe Commerce to meet business needs
  • Configure all aspects of Adobe Commerce Cloud
トピック 3
  • Utilize Commerce test frameworks throughout the whole workflow
  • Customize Commerce features
トピック 4
  • Configure Adobe Commerce and make sure the project is set up optimally
  • Review and refactor existing Adobe Commerce customizations
トピック 5
  • Enforce coding standards
  • Troubleshoot infrastructure and configuration issues
トピック 6
  • Troubleshoot to identify the root cause of issues with Adobe Commerce
  • Troubleshoot design flows
  • Configure and Deploy

 

質問 # 30
An Adobe Commerce Architect designs a data flow that contains a new product type with its own custom pricing logic to meet a merchant requirement. Which three steps are required when adding a product type with custom pricing? (Choose three.)

  • A. Data patch to register the new product type
  • B. New price model extending \Magento\Catalog\Model\Product\Type\Price
  • C. Custom type model extended from the abstract Product Type model
  • D. A new class with custom pricing logic, extending the abstract Product model class
  • E. Hydrator for attributes belonging to the new product type
  • F. Content of the etc/product_types.xml file

正解:B、C、F


質問 # 31
An Architect needs to integrate an Adobe Commerce store with a new Shipping Carrier. Cart data is sent to the Shipping Carrier's API to retrieve the price and display to the customer. After the feature isimplemented on the store, the API hits its quota and returns the error "Too many requests". The Shipping Carrier warns the store about sending too many requests with the same content to the API.
In the carrier model, what should the Architect change to fix the problem?

  • A. ln_doShipmentRequest()f call canCollectRates() before sending request to the API.
  • B. Override getResponse, save the response to a variable, check if the response exists, then return.
  • C. Implement _setCachedQuotes() and _getCachedQuotes(), return the data if the request matches.

正解:C

解説:
Explanation
The carrier model class can implement caching methods to store and retrieve the quotes from the API based on the request parameters. This can reduce the number of API calls and improve the performance of the shipping rate calculation. The _setCachedQuotes() method can save the response from the API to a cache storage, and the _getCachedQuotes() method can check if there is a cached response for the current request and return it if it exists. References: Caching in carrier model, Carrier model interface


質問 # 32
An Architect needs to create an additional regional UK website with its own website currency set to GBP in Adobe Commerce. An existing US website is using USD as a default base and website currency.
After the first week of sales in the new UK website, an administrator notices that all sales totals in Sales Orders report show £0.00.
How should this issue be resolved?

  • A. Refresh Lifetime Statistics for "Total Invoiced'.
  • B. Make sure that orders are shipped and not left in processing state.
  • C. Configure currency rates for GBP and USD, so they are not empty.

正解:C

解説:
Explanation
The issue here is that the sales totals in Sales Orders report show £0.00 for the new UK website. This is because the currency rates for GBP and USD are not configured, so the system cannot convert the order amounts from GBP to USD. The solution is to configure the currency rates for GBP and USD, so they are not empty. This will allow the system to calculate the sales totals in USD for the report. References:
https://experienceleague.adobe.com/docs/commerce-admin/stores-sales/site-store/currency/currency-update.html


質問 # 33
An Adobe Commerce Architect needs to log the result of a ServiceClass:: getData method execution after all plugins have executed. The method is public, and there are a few plugins declared for this method. Among those plugins are after and around types, and all have sortOrder specified.
Which solution should be used to meet this requirement?

  • A. Declare a new plugin with the sortOrder value lower than the lowest declared plugin sortOrder and implement aroundGetData method.
  • B. Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement aroundGetData method.
  • C. Declare a new plugin with the sortOrder value higher than the highest declared plugin sortOrder and implement afterGetData method.

正解:C

解説:
Explanation
This solution ensures that the new plugin will execute after all the existing plugins for the ServiceClass::getData method, and will be able to log the final result of the method execution. The afterGetData method of the new plugin will receive the result of the method as a parameter, and can use any logging mechanism to record it. The sortOrder value of the new plugin should be higher than the highest declared plugin sortOrder, so that it will run last in the sequence of plugins. The after type of plugin is preferred over the around type of plugin, because it is simpler and more efficient, and does not require calling the proceed() method.
References:
Plugins (Interceptors) | Adobe Commerce Developer Guide
Plugin best practices | Adobe Commerce Developer Guide


質問 # 34
An Adobe Commerce Architect is working on a scanner that will pull prices from multiple external product feeds. The Architect has a list of vendors and decides to create new config file marketplace.feeds.xml.
Which three steps can the Architect take to ensure validation of the configuration files with unique validation rules for the individual and merged files? (Choose three.)

  • A. Create validation rules in marketplace.schema.xsd.
  • B. Provide schema to validate a merged file.
  • C. Add the Uniform Resource Name to the XSD file in the config XML file.
  • D. Provide schema to validate an individual file.
  • E. Create a class that implements \Magento\Framework\Config\Datainterface.
  • F. Implement validation rules in the Converter class for the Config Reader

正解:A、B、D

解説:
Explanation
The Architect can take the following steps to ensure validation of the configuration files with unique validation rules for the individual and merged files:
Create validation rules in marketplace.schema.xsd. This file defines the structure and constraints of the XML elements and attributes for the marketplace.feeds.xml configuration file. The Architect can use this file to specify the required and optional elements, data types, values, and patterns for the configuration file.
Provide schema to validate a merged file. This schema is used to validate the final configuration file that is generated after merging all the individual configuration files from different modules. The Architect can use this schema to check the consistency and completeness of the merged configuration file.
Provide schema to validate an individual file. This schema is used to validate each individual configuration file from each module before merging them. The Architect can use this schema to check the syntax and validity of each configuration file.
References:
https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/starter-architecture.htm


質問 # 35
A client is migrating to Adobe Commerce Cloud and has approximately 800 existing redirects that must be implemented. The number of redirects cannot be reduced because all redirects are specific, and do not match any pattern.
How should the redirects be configured to ensure performance?

  • A. Add each redirect as a URL rewrite via the admin Ul.
  • B. Use VCL snippets to offload the redirect to Fastly.
  • C. Add each redirect in the magento/routes.yaml file.

正解:B

解説:
Explanation
Option B is correct because using VCL snippets to offload the redirect to Fastly is the best way to configure the redirects and ensure performance. VCL snippets are custom code segments that can be added to the Fastly configuration to modify the behavior of the caching service. By using VCL snippets, the redirects can be handled at the edge server level, without reaching the Magento application or the database. This reduces the server load and improves the response time for the redirected requests1.
Option A is incorrect because adding each redirect in the magento/routes.yaml file is not a recommended way to configure the redirects. The magento/routes.yaml file is used to define custom routes for Magento Cloud projects, such as mapping domains or subdomains to environments or services. Adding redirects in this file can cause conflicts with the existing routes and affect the routing logic of the project2.
Option C is incorrect because adding each redirect as a URL rewrite via the admin UI is not an optimal way to configure the redirects. The URL rewrite feature in Magento allows creating custom URLs for products, categories, and CMS pages, and redirecting them to their canonical URLs. However, adding a large number of URL rewrites can increase the database size and affect the performance of the Magento application. Moreover, using the admin UI for this task can be tedious and error-prone3.
References:
1: Custom VCL snippets | Adobe Commerce Developer Guide
2: Configure routes | Adobe Commerce Developer Guide
3: URL Rewrites | Adobe Commerce User Guide


質問 # 36
An Architect working on a headless Adobe Commerce project creates a new customer attribute named my_attribute. Based on the attribute value of the customer, the results of GraphQI queries are modified using a plugin. The frontend application is communicating with Adobe Commerce through Varnish by Fastly. which is already caching the queries that will be modified. The Adobe Commerce Fastly extension is installed, and no other modifications are made to the application.
Which steps should the Architect take to make sure the vcl_hash function of Varnish also considers the newly created attribute?

  • A. Create a new class inheriting from Magento\customer\customerData\stctionSourceinterface and returning the value of my_attributefrom the getSectionData function. Then add thisClaSS through the sectionSourceMap array Of Magento\Customer\CustomerData\SectionPoolInterface.
  • B. Create a new ClaSS inheriting from
    Magento\GraphQlCache\Model\CacheId\CacheIdFactorProvidftrInterface and returning the Value of my_attribute from the getFactorValuefunction and my_attribute from the getFactorName function. Then add this class through Dl to the idFactorProviders array ofMagento\GraphQlCache\Model\CacheId\CacheIdCalculator.
  • C. Createa new class inheriting from Magento\Framework\GraphQi\Query\Resolver\identityinterfaca and returning the value of my_attributefrom the getidentities function.
    Then specify a ecache(cacheidentity: Path\\To\\identityclass) directive for each GraphQL query to include the newly created IdentityClass to each query that adds the cache tags for each customer.

正解:B

解説:
Explanation
To make sure the vcl_hash function of Varnish considers the newly created attribute, the Architect needs to do the following steps:
Create a new class that implements the
Magento\GraphQlCache\Model\CacheId\CacheIdFactorProviderInterface interface. This interface defines two methods: getFactorName and getFactorValue. The getFactorName method should return the name of the attribute, in this case, my_attribute. The getFactorValue method should return the value of the attribute for the current customer, which can be obtained from the customer session or customer repository1.
Add this class to the idFactorProviders array of
Magento\GraphQlCache\Model\CacheId\CacheIdCalculator through dependency injection. The CacheIdCalculator is responsible for generating a cache ID for each GraphQL request based on the factors provided by the idFactorProviders. By adding the new class to this array, the Architect ensures that the cache ID will include the value of my_attribute1.
The cache ID is then used by Varnish to hash and lookup the cached response for each request. By including my_attribute in the cache ID, the Architect ensures that Varnish will serve different responses based on the attribute value of the customer2.
Magento_GraphQlCache module | Magento 2 Developer Documentation
Varnish caching | Adobe Commerce 2.4 User Guide - Magento


質問 # 37
An Architect needs to review a custom product feed export module that a developer created for a merchant.
During final testing before the solution is deployed, the product feed output is verified as correct. All unit and integration tests for code pass.
However, once the solution is deployed to production, the product price values in the feed are incorrect for several products. The products with incorrect data are all currently part of a content staging campaign where their prices have been reduced.
What did the developer do incorrectly that caused the feed output to be incorrect for products in the content staging campaign?

  • A. The developer forgot to use the getContentStagingValue method to retrieve the active campaign value of the product data.
  • B. The developer retrieved product data directly from the database using the entity_id column rather than a collection or repository.
  • C. The developer did not check for an active content staging campaign and emulates the campaign state when retrieving product data.

正解:C

解説:
Explanation
Option C is correct because the developer did not check for an active content staging campaign and emulate the campaign state when retrieving product data. Content staging campaigns can modify the product data such as price, name, description, and so on, based on a schedule. To get the correct product data for a specific date and time, the developer needs to use the Magento\Staging\Model\VersionManager class to set the current version ID and emulate the campaign state1. Otherwise, the product data will be retrieved from the default store view without applying the campaign changes.
Option A is incorrect because retrieving product data directly from the database using the entity_id column is not necessarily wrong. It may not be the best practice, but it does not cause the feed output to be incorrect for products in the content staging campaign. The content staging campaigns are stored in separate tables with a version ID that links to the main product table2. The developer can still join these tables and query the product data based on the version ID and date.
Option B is incorrect because there is no such method as getContentStagingValue in Magento 2. The developer cannot use this method to retrieve the active campaign value of the product data. The correct way to get the product data for a specific campaign is to use the Magento\Staging\Model\VersionManager class as mentioned above.
References:
1: Content Staging | Adobe Commerce Developer Guide
2: Content Staging | Adobe Commerce Developer Guide


質問 # 38
An Adobe Commerce Architect needs to scope a bespoke news section for a merchants Adobe Commerce storefront. The merchant's SEO agency requests that the following URL structure:
news/{date}/{article_url_key}, where {date} is the publication date of the article, and {article_url_key} is the URL key of the article.
The Architect scopes that a news entity type will be created. The date and URL key data will be stored against each record and autogenerated on save. The values will be able to be manually overridden.

  • A. Create a plugin that intercepts Magento\Framework\App\Action: :(), looks for the news portion of the URL, and if it matches, loads the relevant news article by matching the URL date and URL key parts.
  • B. The Architect needs to manage routing this functionality and adhere to best practice. Which two options should the Architect consider to meet these requirements? (Choose two.)
  • C. Create a standard controller route and mapping the internal URLs (such as news/article/view/id/i) to rewrites that are generated on save and then stored in the URL rewrites table.
  • D. Create a standard controller route and an index/index controller class that loads the relevant news article by matching the URL date and URL key parts.
  • E. Create a custom router that runs before the standard router and matches the news portion of the URL, then looks for and loads a news article by matching the date and URL key parts of the URL

正解:C、E

解説:
Explanation
These two options are both valid ways to manage routing for the bespoke news section and adhere to best practice. Option B leverages the existing URL rewrite functionality of Adobe Commerce, which allows creating custom URLs for any entity type and storing them in the database. This option requires creating a standard controller route for the news entity type, such as news/article/view/id/i, where i is the news article ID.
Then, on saving each news article, a rewrite rule is generated that maps the internal URL to the desired SEO-friendly URL, such as news/{date}/{article_url_key}. The rewrite rule is stored in the url_rewrite table, which is used by the standard router to match and redirect requests.
Option C involves creating a custom router class that implements \Magento\Framework\App\RouterInterface and runs before the standard router in the routing process. The custom router class can match the news portion of the URL and extract the date and URL key parts from it. Then, it can look for and load a news articlethat matches those values using a model or repository class. If a match is found, it can set the request parameters accordingly and dispatch the request to a controller action that renders the news article page.
References:
Routing | Adobe Commerce Developer Guide
URL Rewrites | Adobe Commerce Developer Guide
Custom Router | Adobe Commerce Developer Guide


質問 # 39
A merchant is utilizing an out-of-the-box Adobe Commerce application and asks to add a new reward card functionality for customers. During the code review, the Adobe Commerce Architect notices the reward_card_number attribute setup created for this functionality is causing the customer attribute to be unavailable in the My account/My rewards page template.

What should be added to set the customer attribute correctly?

  • A. group property should be added with a value of 1
  • B. scope property should be added with a value of global
  • C. system property should be added with a value of true

正解:A

解説:
Explanation
The group property determines which section of the customer account the attribute belongs to. By setting the group property to 1, the reward_card_number attribute will be assigned to the default group, which is the Account Information section. This will make the attribute available in the My account/My rewards page template. References:
https://experienceleague.adobe.com/docs/commerce-admin/customers/customer-accounts/attributes/attribute-pro


質問 # 40
While developing a new functionality for a website in developer mode with all cache types enabled, an Adobe Commerce Developer needs to add \Magento\Sales\Model\Service\InvoiceService SinvoiceService as a new dependency to an existing page action controller in Vendor\CustomModule\Controller\Index\Index . This is accomplished as follows:

After cleaning the f ull_page cache and reloading the page, the developer encounters the following exception:
Recoverable Error: Argument 2 passed to Vendor\CustomModule\Controller\Index\Index::__construct() must be an instance of
\Magento\Sales\Model\Service\InvoiceService [...]
Which action should the Architect recommend to the developer to fix this error?

  • A. Remove the generated Child ClaSS from generated/code/Vendor/CustomModule/Controller/Index/Index.
  • B. Clean the block_html cache along with full_page cache.
  • C. Add the new \Magento\sales\Model\service\invoiceService Sinvoiceservice dependency at the end of the constructor signature.

正解:A

解説:
Explanation
The error is caused by the generated child class not being updated with the new dependency. Removing the generated child class will allow the system to generate a new child class with the correct dependency. The generated child class is a proxy class that extends the original controller class and overrides the constructor to inject the dependencies using the object manager. The generated child class is created when the system runs in developer mode with cache enabled, to avoid performance issues. However, when a new dependency is added to the original controller class, the generated child class does not reflect the change and causes a mismatch in the constructor arguments. Therefore, deleting the generated child class from the generated/code directory will solve the problem.
References:
Generated code | Adobe Commerce Developer Guide
Constructor signature change | Adobe Commerce Developer Guide


質問 # 41
An Adobe Commerce store owner sets up a custom customer attribute "my.attribute".
An Architect needs to display additional content on the home page, which should display only to Customers with "my.attribute" of a certain value and be the same content for all of them. The website is running Full Page Cache.
With simplicity in mind, which two steps should the Architect take to implement these requirements? (Choose two.)

  • A. Add a new context value of "my_attribute" to Magento\Framework\App\Http\Context
  • B. Add a dynamic block with the content to the Home Page
  • C. Use customer-data JS library to retrieve "my.attribute" value
  • D. Add a custom block and a pHTML template with the content to the cmsjndexjndex.xml layout
  • E. Create a Customer Segment and use 'my.attribute' in the conditions

正解:A、B

解説:
Explanation
To display additional content on the home page based on a custom customer attribute, the Architect needs to do the following steps:
Add a new context value of "my_attribute" to Magento\Framework\App\Http\Context. This will allow the Full Page Cache to generate different versions of the page for customers with different values of
"my.attribute". The context value can be set using a plugin on the Magento\Customer\Model\Context class.
Add a dynamic block with the content to the Home Page. A dynamic block is a type of content block that can be configured to display only to specific customer segments or conditions. The Architect can use the 'my.attribute' in the conditions of the dynamic block and assign it to the Home Page in the Content > Blocks section of the Admin Panel. References:
Private content | Magento 2 Developer Documentation
Dynamic Blocks | Adobe Commerce 2.3 User Guide - Magento


質問 # 42
A custom cron job has been added to an Adobe Commerce system to collect data for several reports. Its crontab. xml configuration is as follows:

The job is data intensive and runs for between 20 and 30 minutes each night.
Within a few days of deployment, it is noticed that the sites sitemap. xml file has not been updated since the new job was added.
What should be done to fix this issue?

  • A. Create a new cron group for the reporting job, specifying
    <use_separate_process>i</use_separate_process>
  • B. Break the data gathering job into a number of smaller jobs, so that each individual job runs for a maximum of 5 minutes
  • C. Change the schedule of the siten.aP_generate cron job to 30 0 * * *so that it runs after the gather_reporting_data job has completed.

正解:A

解説:
Explanation
The issue here is that the gather_reporting_data job is running for a long time and blocking the sitemap_generate job from running. The solution is to create a new cron group for the reporting job and specify <use_separate_process>i</use_separate_process> so that the reporting job runs in a separate process and does not block the sitemap_generate job. References:
https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/architecture/starter-architecture.htm


質問 # 43
The development of an Adobe Commerce website is complete. The website is ready to be rolled out on the production environment.
An Architect designed the system to run in a distributed architecture made up of multiple backend webservers that process requests behind a Load Balancer.
After deploying the system and accessing the website for the first time, users cannot access the Customer Dashboard after logging in. The website keeps redirecting users to the sign-in page even though the users have successfully logged in The Architect determines that the session is not being saved properly.
In the "app/etc/env.php", the session is configured as follows:

What should the Architect do to correct this issue?

  • A. Update the session host value to a shared Redis instance
  • B. increase the session size with the command config:set system/security/max_session_size_admin
  • C. Utilize the Remote Storage module to synchronize sessions between the servers

正解:A

解説:
Explanation
Option A is correct because updating the session host value to a shared Redis instance in the
"app/etc/env.php" file will allow the session to be saved properly and prevent users from being redirected to the sign-in page after logging in. Redis is a fast and reliable in-memory data store that can be used for session storage in Magento 2. By using a shared Redis instance, the session data can be accessed by any of the backend web servers behind the load balancer, regardless of which server handled the initial request. This ensures that the user's session is maintained and consistent across different servers1.
Option B is incorrect because increasing the session size with the command config:set system/security/max_session_size_admin will not solve the issue of session not being saved properly.
This command only affects the admin session size limit, not the customer session size limit. Moreover, this command does not address the root causeof the issue, which is that the session data is not shared among the backend web servers2.
Option C is incorrect because utilizing the Remote Storage module to synchronize sessions between the servers is not a viable solution for this issue. The Remote Storage module is a feature of Magento Commerce Cloud that allows storing media files and other static content on a remote storage service such as AWS S3 or Azure Blob Storage. This module does not support synchronizing sessions between servers, as sessions are dynamic and transient data that need to be stored in a fast and accessible data store such as Redis3.
References:
1: Use Redis for session storage | Adobe Commerce Developer Guide
2: Security | Adobe Commerce User Guide
3: Remote storage | Adobe Commerce Developer Guide


質問 # 44
A client has multiple warehouses where orders can be fulfilled. The cost of shipping goods from each warehouse varies by day, due to the number of workers available. The Architect needs to make sure that when an order is shipped, it is shipped from the lowest cost warehouse that is open.
How should this functionality be implemented?

  • A. Create a new class implementing
    Magento\invtntorysourceSelectionApi\Modei\sourceSelectioninterfacece. which returns open warehouses sorted by cost.
  • B. Create anew class as a preference for
    Magento\inventoryShipping\piugin\Sales\shipment\AssignSourceCodeToShipmentPlugin to set the lowest-cost warehouse on a shipment.
  • C. Create an after plugin OnHagento\InventoryDistanceBasedSourceSelection\Hodel\Algorithms\DistanceBasedAlgorithto sortto Warehouse sources by cost

正解:A

解説:
Explanation
According to the Adobe Commerce documentation, the Source Selection Interface is the main interface for implementing custom source selection algorithms. The interface defines a method called execute(), which takes a list of items to be shipped and a stock ID as parameters, and returns a SourceSelectionResultInterface object, which contains the recommended sources and quantities for each item. The Architect can create a new class that implements this interface and provides the logic for finding the lowest-cost warehouse that is open for each item. The Architect can then register the new class as an option for the source selection algorithm in the di.xml file of the custom module.
References:
Source Selection Algorithm | Adobe Commerce Developer Guide
Source Selection Interface | Adobe Commerce Developer Guide


質問 # 45
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.)

  • A. Append the custom xml file name in "Magento\Config\Model\Config\Structure\Reader" in di.xml
  • B. Create a Data class that implements "\Magento\Framework\Config\Data"
  • C. Inject a "reader" dependency for "Magento\Framework\Config\Data" in di.xml
  • D. Make a Reader class that implements '\Magento\Framework\Config\Reader\Filesystem"
  • E. Write a plugin for \Magento\Framework\Config\Data::get() and read the custom xml files

正解:B、D

解説:
Explanation
According to the Adobe Commerce documentation, to create a new xml configuration file, the Architect needs to create a Data class and a Reader class for the custom module. The Data class is responsible for storing and retrieving the configuration data from the cache or the Reader class. The Data class should implement the
"\Magento\Framework\Config\Data" interface or extend the "\Magento\Framework\Config\Data" class. The Reader class is responsible for reading and validating the xml configuration files from the file system. The Reader class should implement the '\Magento\Framework\Config\Reader\Filesystem" interface or extend the
'\Magento\Framework\Config\Reader\Filesystem" class. The Architect also needs to declare the Data class and the Reader class in the di.xml file of the custom module, and specify the name of the xml configuration file, the converter class, and the schema locator class for the Reader class.
References:
Configuration types | Adobe Commerce - Experience League
Create configuration types | Adobe Commerce - Experience League


質問 # 46
An Architect wants to create an Integration Test that does the following:
* Adds a product using a data fixture
* Executes $this->someLogic->execute($product) on the product
* Checks if the result is true.
$this->someLogic has the correct object assigned in the setup() method.
Product creation and the tested logic must be executed in the context of two different store views with IDs of 3 and 4, which have been created and are available for the test.
How should the Architect meet these requirements?

  • A. Create one test class with one test method. Use the
    \Magento\TestFramework\store\ExecuteinstoreContext class once in the fixture and another time in the test.
  • B. Create one test class with two test methods. Use the emagentostorecontext 3 annotation in one method and amagentostorecontext 4 in the other one.
  • C. Create two test classes with one test method each. Use the @magentoExecuteinstoreContext 3 and
    $MagentoExecuteinStoreContext 4 annotations on the class level.

正解:A

解説:
Explanation
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 \Magento\TestFramework\TestCase\AbstractController or
\Magento\TestFramework\TestCase\AbstractBackendController, 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 \Magento\TestFramework\Store\ExecuteInStoreContext 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(\Magento\TestFramework\Store\ExecuteInStoreContext::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);
}
References:
Integration tests | Magento 2 Developer Documentation
Data fixtures | Magento 2 Developer Documentation
Magento\TestFramework\Store\ExecuteInStoreContext | Magento 2 Developer Documentation


質問 # 47
A developer needs to uninstall two custom modules as well as the database data and schemas. The developer uses the following command: bin/magento module:uninstall Vendor_SampleMinimal Vendor_SampleModifyContent When the command is run from CLI, the developer fails to remove the database schema and data defined in the module Uninstall class. Which three requirements should the Architect recommend be checked to troubleshoot this issue? (Choose three.)

  • A. invoked uninstall() and uninstallschema are defined in the Uninstall class
  • B. --remove-schema and --remove-data options are specified as arguments for the CLI command
  • C. --remove-data option is specified as an argument for the CLI command
  • D. invoked unlnstalK) method is implemented in the Uninstall class
  • E. bin/magento maintenance:enable command should be run in CLI before
  • F. composer.json file is present and defines the module as a composer package

正解:C、D、F


質問 # 48
A representative of a small business needs an Adobe Commerce Architect to design a custom integration of a third-party payment solution. They want to reduce the list of controls identified in their Self-Assessment Questionnaire as much as possible to achieve PCI compliance for their existing Magento application.
Which approach meets the business needs?

  • A. Utilize a trusted signed certificate issued by a Certification Authority (CA) to secure each connection made by the payment solution protocol via https.
  • B. Utilize the Advanced Encryption standard (aes-256) algorithm to encrypt all customer-sensitive data from the payment module.
  • C. Utilize the payment provider iframe system to isolate content of the embedded frame from the parent web page.

正解:C

解説:
Explanation
Using an iframe system for payment integration can help reduce the PCI scope and compliance burden for the merchant, as the payment data is collected and processed by the payment service provider (PSP) within the iframe, without touching the merchant's website or server. This way, the merchant can leverage the PSP's PCI certification and avoid storing or transmitting any sensitive cardholder data on their own system. The iframe also provides a secure barrier between the host webpage and the loaded page, preventing any access or manipulation of the payment data by malicious actors. To implement this approach, the merchant needs to embed the PSP's payment form in their checkout page using an iframe element, and configure the communication between the iframe and the host page using JavaScript123.


質問 # 49
An existing Adobe Commerce website is moving to a headless implementation.
The existing website features an "All Brands'' page, as well as individual pages for each brand. All brand-related pages are cached in Varnish using tags in the same manner as products and categories.
Two new GraphQL queries have been created to make this information available to the frontend for the new headless implementation:

During testing, the queries sometimes return out-of-date information. How should this problem be solved while maintaining performance?

  • A. Specify a @cacgecacheable(cacheable: false) directive for each GraphQL query, making sure that the data returned is not cached, and is up to date
  • B. Each GraphQL query's resolver class should inject \Magento\GraphQlcache\Model\cacheableQuery and call setcachevalidity(true) on it as part of the resolver's resolve function.
  • C. Specify a $cache(cacheidentity: Path\\To\\identityclass) directive for each GraphQL query, corresponding to a class that adds cache tags for relevant brands and associated products

正解:C

解説:
Explanation
This solution ensures that the data returned by the GraphQL queries is up to date, while also maintaining performance. By specifying a $cache(cacheidentity: Path\To\identityclass) directive for each GraphQL query, the relevant brands and associated products will be added as cache tags.


質問 # 50
An Adobe Commerce Architect needs to customize the workflow of a monthly installments payment extension. The extension is from a partner who is contracted with the default website Payment Service Provider (PSP), which has its own legacy extension (a module using deprecated payment method).
The installment payment partner manages only initializing a payment, and then hands the capture to be executed by the PSP Once the amount is successfully captured, the PSP notifies the website through a webhook. The goal of the webhook is only to create an "invoice" and save the "capture information" to be used later for refund requests through the PSP itself.
The Architect needs the most simple solution to capture the requested behavior.
Which solution should the Architect implement?

  • A. Change the can_capture attribute for the payment method under config.xml to be
    <can_capture>0</can_capture>
  • B. Add a plugin before the $invoice->capture() and change Its input to prevent the call of the
    $Payment->capture()
  • C. Declare a capture Command with type Magento\Payment\Gateway\Command\NullCommand for the payment method CommandPool in di.xml

正解:C

解説:
Explanation
Option C is the correct solution because declaring a capture command with type Magento\Payment\Gateway\Command\NullCommand for the payment method command pool in di.xml will prevent the default capture logic from being executed. The NullCommand class is a dummy implementation of the CommandInterface that does nothing. This way, the payment capture will be handled by the PSP webhook, and the invoice will be created accordingly12 Option A is not a correct solution because adding a plugin before the $invoice->capture() and changing its input to prevent the call of the $payment->capture() will require modifying the core Magento code, which is not recommended. Moreover, this solution will affect all payment methods that use the invoice capture logic, not just the monthly installments payment extension3 Option B is not a correct solution because changing the can_capture attribute for the payment method under config.xml to be <can_capture>0</can_capture> will disable the capture functionality for the payment method entirely. This means that the invoice cannot be created or captured, even by the PSP webhook4 References:
1:
https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/payments-integrations/payment-ga
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Payment/Gateway/Command/NullCo
https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/customization/best-practices.html?
https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/payments-integrations/payment-ga


質問 # 51
......

無料Adobe Commerce AD0-E722試験問題:https://jp.fast2test.com/AD0-E722-premium-file.html


弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

我々の働いている時間: ( GMT 0:00-15:00 )
月曜日から土曜日まで

サポート: 現在連絡 

English Deutsch 繁体中文 한국어