Test
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Este test tiene tiempo límite, así que se abre en el reproductor de siempre.
Preguntas del test (30)
1You see this code in etc/adminhtml/routes.xml:
<route id="mymodule" frontName="user-subscriptions">
<module name="MyCompany_MyModule" />
</route> You have placed a controller in Controller/Index/Subscribe.php. If you want to create layout XML instructions for this controller, what would be the layout XML's filename?- Amymodule_index_subscribe.xml
- Bmymodule_subscribe_[ACTION NAME].xml
- Cuser_subscriptions_index_subscribe.xml
- Duser_subscriptions_subscribe_[ACTION NAME].xml
2You have created a new product type, sample, and need to customize how it renders on the shopping cart page. Keeping maintainability in mind, how do you add a new renderer?
- ACreate the layout file, checkout_cart_item_renderers.xml, reference the checkout.cart.item.renderers block and add a new block with an as="sample" attribute.
- BOverride the cart/form.phtml template and add logic for the sample product type.
- CCreate the layout file, checkout_cart_index.xml, and reference the checkout.cart.renderers block and add a block with the as="sample" attribute.
- DCreate the layout file, checkout_cart_index.xml, and update the cart page's uiComponent to appropriately render the sample product type.
3You are building an tool that imports products from an ERP. There are 20 columns of additional information that are associated with each product. This extra information must also be associated with an update time to know when to refresh the data. Keeping maintainability in mind, how do you build this into Magento?
- AUtilize an extension attribute.
- BOverride the Product model and add the fields.
- CCreate a separate model and build code to associate the two record types.
- DCreate 20 EAV attributes and check their updated_at column.
4What interface should a frontend controllers action implement?
- A\Magento\Framework\App\ActionInterface
- B\Magento\Frontend\Controller\ActionInterface
- C\Magento\Frontend\Controller\ControllerInterface
- D\Magento\Framework\App\ControllerInterface
5You are making some major adjustments to a core Magento class (ClassA). These adjustments are only necessary when utilized from a specific Magento class (ClassB). You have created MyClass that contains the needed customizations.
Keeping upgradeability in mind, how do you configure di.xml to make the substitution happen?- AEnsure that MyClass extends ModuleA and set the <argument/>, for ModuleB to point to your new class in di.xml.
- BSet a <preference/> for ModuleA to be replaced by MyClass
- CCreate a rewrite node that injects MyClass into ClassB.
- DCreate a virtual type that extends ModuleB, specifying an <argument/> for MyClass.
6You are customizing the display of product details page. On this page ur customer need to change the url in which the product category name will be appear as http://mystore.com/women/tops-women/helena-hooded-fleece.html , Keeping ,maintainability in mind ,How to get product url with category?
- AAdmin -> Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> "Use Categories Path for Product URLs" set to "Yes"
- BIt is not possible to display Categories name on product url
- C$product->setCategoryId($categoryId)->getProductUrl();
- DYou Can Build category URL path \vendor\magento\module-catalog-url-rewrite\Model\CategoryUrlPathGenerator.php
7You are building a new module to add extra functionality to the Magento application. What files are required?
- Aregistration.php
- Betc/module.xml
- Ccomposer.json
- DSetup/InstallSchema.php
- Eetc/config.xml
8You need to add the Google Tag Manager (GTM) to every page. What three steps do you take to accomplish this in MyCompany_MyModule?
- AAdd into view/frontend/layout/default.xml.
- BCreate view/frontend/layout/default.xml.
- CCreate view/frontend/templates/script.phtml and add GTM code.
- DRun bin/magento create:module:template script.phtml
- ECopy vendor/module-catalog/view/template/script.phtml to view/template/script.phtml and add GTM script.
9You need to control access to a custom controller action. How do you tell Magento about this new control option?
- ACreate etc/acl.xml and add <resource id="MyCompany_MyModule::customAction" ... />
- BIn the controller, implement the _isAllowed method.
- CCreate etc/adminhtml/acl.xml and add <acl id="MyCompany_MyModule::customAction" ... />
- DUse the CLI to add the new resource option.
10You are trying to determine why a product is not appearing in a category. What table does Magento on the frontend to locate the relationship between a category and its products?
- Acatalog_category_product
- Bcatalog_product_parent
- Ccatalog_category_product_index
- Dcatalog_category_product_relationship
11How do you instruct Magento to enable a new module?
- Abin/magento module:enable MyCompany_MyModule
- BMagento automatically enables all new modules.
- CGo to Admin > System > Module Management.
- DAdd MyCompany_MyModule to the setup_module table.
12As you are scanning folder in the vendor/module-catalog directory, you see a directory that is named Ui.
What is this folder's purpose?- AIt contains UI component data providers and component information.
- BIt contains templates, CSS and JS pertinent to the module.
- CIt contains the block PHP files that render HTML onto the frontend.
- DIt is not a normal folder and further investigation is necessary to determine the purpose.
13You are updating a module to add extra functionality to the Magento application, Where would Magento look for modules?
- Aapp/code/VendorName/ModuleName
- Bvendor/vendor-name/module-name
- Capp/vendor/vendor-name/module-name
- Dlib/vendor-name/module-name
14You are reviewing a module to some special functionality to the Magento 2 application, You see directory /Console, What task you think in this directory contain script for this modules?
- Acontains CLI commands
- Bcontains any PHP classes exposed to the API
- Ccontains cron job definitions.
- Dcontains section files
- Eopen directory /Console & check script what code contaib
15You are reviewing a module to some special functionality to the Magento 2 application, You see directory /CustomerData, What task you think in this directory contain script for this modules?
- AContains section files that works with the data stored on the client side.
- Bcontains aggregated functionality.
- Ccontains localization files.
- Dcontains view files, including static view files, design templates, email templates, and layout files.
16You are building a new module to add extra functionality to the Magento application.You want to works with CustomerData the data stored on the client side. Where initialized sections Cart and Directory-data are on the server side via the classes ?
- AMagento\Checkout\CustomerData\Cart and Magento\Checkout\CustomerData\DirectoryData
- BMagento\Checkout\Api\Cart and Magento\Checkout\Api\DirectoryData
- CMagento\Checkout\Block\Cart and Magento\Checkout\Block\DirectoryData
- DMagento\Checkout\Plugin\Cart and Magento\Checkout\Plugin\DirectoryData
17Magento and third-party developers can find it difficult to track and report the dependencies that customized extensions have on other extensions. To address these issues, the Magento system introduces service contracts. What is a Service Contracts - Data interfaces ?
- Aset of PHP interfaces that are defined for a module includes data interfaces
- Bset of API interfaces that are defined for a module includes web APIs
- Cset of UI Library that are defined for a module includes ui content
- Dset of JS Library that are defined for a module includes js Library
18You have created a module to show manufacturer-list, but in your page need to show Pagination that already ready in your block. Keeping maintainability in mind, where you call echo $block->getPagerHtml(); ?
- A/Manufacturer/view/frontend/templates/content.phtml
- B/Manufacturer/Block/Index.php
- C/Manufacturer/Controller/Index/Index.php
- D/Manufacturer/view/frontend/layout/manufacturer_index_index.xml
19You have created a module to show manufacturer-list,Your customer need url as www.storeurl/manufacturer which file are mendatory to show correct url?
- AController: /Manufacturer/Controller/Index/Index.php
- BBlock: /Manufacturer/Block/Index.php
- CLayout: Manufacturer/view/frontend/layout/manufacturer_index_index.xml
- DTemplates:/Manufacturer/view/templates/content.phtml
- ELayout: Manufacturer/view/frontend/layout/index_index.xml
- FLayout: Manufacturer/view/frontend/layout/manufacturer.xml
20You are facing a bug, which is supposedly caused by the customization of \Magento\Catalog\Api\ProductRepositoryInterface::save(). To resolve the issue, you decide to find all logic which customizes this method. Which two places do you search for customization declarations? (Choose 2)
- A*/di.xml
- B*/events.xml
- C*/config.xml
- D*/plugins.xml
21You are implementing a customization of the sales management within a module MyCompany_MySalesProcess. You have created several event observers to add the custom functionality. Each observer is a separate class, but they require some common functionality.
How do you implement the common functionality in the event observers, keeping maintainability and testability in mind?- AYou create a regular class implementing the common functionality as public methods and use constructor injection to make them available to the observers.
- BYou create a trait with the common methods and use the trait in the observer classes.
- CYou create a regular class implementing the common functionality as public static methods and call those from the observers.
- DYou create an abstract class AbstractObserver with the common methods and extend the observer classes from it.
22A custom module is performing an optimized custom query for quote items. The class applies the query customizations on the select object of a quote item collection instance.
public function __construct(
\Magento\Quote\Model\ResourceModel\Quote\Item\Collection $collection) {
$this->collection = $collection;
}
public function fetchData() {
$select = $this->collection->getSelect();
... code modifying $select...
return $this->collection->getData();
}
You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module. How do you resolve the issue, keeping maintainability in mind- AYou change the argument type to \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory and
instantiate the collection using $collectionFactory->create(); - BYou remove the constructor argument and use ObjectManager::getInstance()-
>create(\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::class) to instantiate the collection instead. - CYou inject \Magento\Framework\DB\Select instead of the collection and perform the desired query independently of the collection.
- DYou inject \Magento\Quote\Api\CartItemRepositoryInterface because low level query customizations are not allowed.
- AYou change the argument type to \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory and
23In a custom module you implement the interface \Magento\Framework\App\Config\DataInterface.
/** Configuration data storage @api */
interface DataInterface {
public function getValue($path);
public function setValue($path, $value);
} What version constraint for magento/framework do you add to your module’s composer.json file?- Aminor
- Bmajor
- Cpatch
- Dstable
24You are building CLI that use the console to create a customer account with our custom command as like
php bin/magento customer:user:create --customer-firstname="Mahin" --customer-lastname="Rahman" --customer-email="mahin@example.com" --customer-password="mahin@123" --website="1"
using: protected function configure() { $this->setName('customer:user:create') ->setDescription('Create new customer') ->setDefinition($this->getOptionsList()); } protected function getOptionsList(){ return [ ------------------]; } Which below Option are not required in blank? (Choose 2)- Anew InputOption(Customer::KEY_SENDEMAIL, 0, InputOption::VALUE_OPTIONAL, '(1/0) Send email? (default 0)')
- Bnew InputOption(Customer::KEY_STORE, null, InputOption::VALUE_REQUIRED, '(Required) Store ID'),
- Cnew InputOption(Customer::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, '(Required) Customer password'),
- Dnew InputOption(Customer::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, '(Required) Customer email'),
- Enew InputOption(Customer::KEY_LASTNAME, null, InputOption::VALUE_REQUIRED, '(Required) Customer last name'),
- Fnew InputOption(Customer::KEY_FIRSTNAME, null, InputOption::VALUE_REQUIRED, '(Required) Customer first name'),
- Gnew InputOption(Customer::KEY_WEBSITE, null, InputOption::VALUE_REQUIRED, '(Required) Website ID'),
25You are building CLI that use the console to create a customer account with our custom command, Adding a new command to CLI is based on passing on the argument from the XML level to the class . Dependency Injection comes in handy here. you create the file app/code/Mycompany/Customer/etc/di.xml with the following content: <type name="---------------------"> </type> What is the correct in below?
- AMagento\Framework\Console\CommandList
- BMagento\Framework\Console
- CMagento\Framework\CommandList
- DMagento\Framework\CommandList\Console
26You are creating a new indexer which must run after the targetrule_product_rule index process. When you run bin/magento indexer:reindex, your rule always runs first creating inaccurate data. What is the resolution?
- AUse a dependencies node in your indexer configuration
- BSpecify the sortOrder in your indexer configuration.
- CUse a plugin on the IndexManager class to change load order.
- DCreate a bash script to execute each indexer in the correct order.
27You need to render a product attribute’s raw value as a variable in a script tag. This value will be used to initialize an application on the frontend. How do you render this value?
- A<?= $block->escapeJs($value) ?>
- B<?= $block->escapeJsVar($value) ?>
- C<?= $block->renderJs($value) ?>
- D<?= $block->escapeHtml($value) ?>
28You need to add a new column to the sales_shipment and the sales_shipment_grid tables. Other than utilizing the default addColumn methods, what way is automatic?
- AUtilize the SalesSetup class’ addAttribute method.
- BOn the default EavSetup class, utilize the addColumn method.
- COn the ModuleDataSetupInterface, call $setup->getSales()->addColumn().
- DEnsure your UpgradeSchema class extends CoreSetup and call $this->addSalesColumns().
29You are creating a module that will be sold on the Magento Marketplace. You wish for this module to be easily extensible, and decide to add the capability for other developers to utilize extension attributes. What is the minimum update necessary to enable this capability?
- AAdd the getExtensionAttributes() method and implement ExtensionAttributesInterface in each model.
- BCreate an ExtensionAttributeInterface for each model.
- CEnsure each model extends Magento\Framework\Model\AbstractExtensibleModel.
- DConfigure your models in etc/extension_attributes.xml
30There is a custom extension called MyCompany_MyModule. It has the following layout customization declared in MyCompany/MyModule/view/frontend/layout/default.xml:
<referenceContainer name=”content”>
<block class=”Magento\Framework\View\Element\Template”
name=”my.block”
template=”MyCompany_MyModule::my_template.phtml”
cacheable=”false”/>
</referenceContainer> What will be the result of the customization?- AAll store front pages will be non-cacheable
- BOnly the default landing page will be non-cacheable
- Cmy.block on the default landing page only will be cached using ESI.
- Dmy.block on the all store front pages will be cached using ESI
Información
- Descripción
- POOL-1 30 question, This only my study notes, questions will NOT be found on the final exam. They might be similar. 60 questions 90mi 64% to pass Based on Magento Open Source (2.3) and Magento Commerce (2.3),
- Autor
- Miska Red
- Idioma
- English
- Visitas
- 13.668
- Etiquetas
- Valoración
- 5,0 de 5 · 8 valoraciones Valora este test