Magento Test Upwork

Which statement is false about a service contract?

It enables Magento and third-party developers to report system dependencies through composer.json files and, consequently, guarantee compatibility among Magento versions.
A service contract includes data interfaces, which preserve data integrity, and service interfaces, which hide business logic details from service requestors such as controllers, web services, and other modules.
Magento is a modular system that enables third-party developers to customize and overwrite core parts of its framework. This flexibility comes for free.
A service contract is a set of PHP interfaces that are defined for a module.

Which of the following products do not have a physical presence, and are typically used for such things as services, warranties and subscriptions?

Simple Product
Grouped Product
Virtual Product
Bundle Product

Which of the following GET parameter is used for "not equal to" filtering?

neq
in
nin
None of the above

Factories are special objects that have this purpose:

To create an instance of one non-injectable class or interface
To create an instance of one non-injectable class or object
To create an instance of one non-injectable class or function
None of the above

Which statement is incorrect about Magento 2?

Magento 2 has a new admin theme
Magento 2 is based on Magento 1 code
Magento 2 has jQuery inside
Magento 2 has the same functions as Magento 1

Which of the following will instantiate a product collection?

$collection = Mage::getModel('catalog/product')->getProduct();
$collection = Mage::getModel('catalog/product')->getCollection();
$collection = Mage::getModel({'catalog/product'})->getCollection();
$collection = Mage::getModel('catalog/product')-->getCollectionId();

Which function can be used to get the image Width and Height?

Imagesx() , Imagesy()
getWidth() , getHeight()
scaleX() , ScalyY()
Imagex() , Imagey()

Which statement is correct regarding Theme's registration.php file?

It contains the basic meta-information, like the theme name and the parent theme name, and the theme is inherited from an existing theme.
It is required to register your theme in the system.
This file is optional.
Describes the theme dependencies and some meta-information.

How do you setup a Magento multilingual store?

Change the text with JavaScript
Change language in htaccess file
Create a new store view and change its language
Do a  manual switch in code

Which of the following will log current collection’s SQL query?
Note: There may be more than one right answer.

$collection->printLogQuery(true);
$collection->getSelect()->__toString();
$collection->printLogQuery();
$collection->getSelected()->__toString();

Is it possible to retrieve all the models' ids based on collection filters without loading the collection itself?

You can use getSelect() to retrieve the current collection db select with all the filters applied. You can just tweak it by resetting the columns part and specifying the model's id field instead
Yes, you can use getAllIds() that will return all model id field values
Yes, you can use getModelIds() that will return all model id field values
No, it is impossible

How many tables are created when a new EAV module is created?

3
4
5
6

Which resource model would you implement if you expect to return multiple items from a database query?

group
resource
collection
None of the above    

Which of the following can be used to get the latest n products?

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->getSelect()->order('entity_id desc')->limit(n);
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->getSelect()->orderBy('entity_id desc')->limit(n);
$collection = Mage::getModel('catalog/products')->getCollections();
$collection->getSelect()->orderBy('entity_id desc')->limit(n);
None of the above

Where are dynamic view files located in a theme directory?

<theme_dir>/
├── media/
├── web
│    ├── css/ (except the "source" sub-directory)
│    ├── fonts/
│    ├── images/
│    ├── js/

<theme_dir>/
├── <Vendor>_<Module>/
│    ├── layout/
│    │    ├── override/
│    ├── templates/
├── etc/
├── web/
│    ├── css/
│    │    ├── source/
│    ├── fonts/
│    ├── images/
│    ├── js/
├── composer.json
├── registration.php
├── theme.xml

<theme_dir>/
├── Magento_<module>/
│    ├── web/
│    │    ├── css/
│    │    │    ├── source/
│    ├── layout/
│    │    ├── override/
│    ├── templates/
├── web/
│    ├── css/
│    │    ├── source/

<theme_dir>/
├── <Vendor>_<Module>/
│    ├── web/
│    │    ├── css/
│    │    │    ├── source/
│    ├── layout/
│    │    ├── override/
│    ├── templates/
├── etc/
├── i18n/
├── media/
├── web/
│    ├── css/
│    │    ├── source/
│    ├── fonts/
│    ├── images/
│    ├── js/

Which layer holds the business logic layer of a Magento module?

Presentation Layer
Service Layer
Domain Layer
Persistance Layer

Which of the following files are required for all components?

registration.php, composer.json
composer.json, index.php
registration.php, config.xml
registration.php, composer.json, config.xml

Page layout files are useful in ___ front pages of Magento?

php
rendering
file
component

What is XML-RPC? (choose all that apply)
Note: There may be more than one right answer.

XML-RPC is a remote procedure call (RPC) protocol
XML-RPC is a remote procedure call (SOAP) API
XML to encode its calls and HTTP as a transport mechanism

What step during the layout loading is the  node processed?

After the generation of layout blocks
Before the generation of layout update XML, but after the generation of layout blocks
Before the generation of layout blocks, but after the generation of layout XML
After the generation of layout blocks, but before rendering the page

Which of the following are the methods of PayPal Payment Gateways?
Note: There may be more than one right answer.

Payflow Pro (Includes Express Checkout)
Payflow Link (Includes Express Checkout)
Payflow Add (Includes Express Checkout)
Payflow List (Includes Express Checkout)

Which command can you use to clear the directories?

rm -rf <your Magento install dir>/var/data/* <your Magento install dir>/var/generation/*
rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
rm +rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
rm -rf <your Magento install dir> -> /var/di/* <your Magento install dir>/var/generation/*

How can you extend Bundle updates product listing using the grid UI component located?
Magento/BundleStaging/product/adminhtml/ui_component/bundle_update_product_listing.xml

Yes
It should be, Magento/BundleStaging/view/adminhtml/ui_component/bundle_update_product_listing.xml
No, it should be Magento/BundleStaging/controller/adminhtml/ui_component/bundle_update_product_listing.xml
None of the above

Name the product types that are available in Magento?

Simple Products, Grouped Products
Configurable Products, Virtual Products
Bundled Products, Downloadable Products
All of the above

What is the file format for a data upgrade script?

{$module}-v2.php
install-data-v2-{$module}.php
upgrade-0.0.2.php
data-upgrade-0.0.1-0.0.2.php

Which interface is not provided by service contracts?

Repository interfaces
Model interfaces
Management interfaces
Metadata interfaces

Magento has the following codepool?

Community, Advanced and Local
Core, Community and Local
Remote, Core and Community
None of the above.

What happens when you edit an existing order using the order management page?

Depending on the order status, different editing forms appear for the current order
The current order is cancelled and a new order is created from scratch based on the current order's data.
It will work well and let me edit the order.
A form appears that allows you to edit shopping information for the current order only

What is the difference between Mage::getSingleton() and Mage::getModel() in Magento?

Mage::getSingleton() always finds for an existing object if not then it will create a new object but Mage::getModel() always creates a new object
Mage::getSingleton() always creates a new object but Mage::getModel() always finds for an existing object if not then create a new object
There is no difference
None of the above

Which command allows you to reset  Magento files and Directory permissions?

find . –type f –exec chmod 755 {} ;
find . –type d –exec chmod 644 {};
chmod x mage

find  –type f –exec chmod 644 {} \;
find  –type d –exec chmod 755 {} \;
chmod +x merge

find . –type f –exec chmod 755 {} ;
find . –type d –exec chmod 644 {} ;
chmod x mage

find . –type f –exec chmod 644 {} \;
find . –type d –exec chmod 755 {} \;
chmod +x mage

Which Magento command is used to display the current deployment mode?

magento deploy:mode
magento mode:show
magento deploy:mode:show
None of the above

Which of the following aspects to the define RESTful API of Magento?
Note: There may be more than one right answer.

Its exposed URIs are formatted in a directory-like structure
It makes usage of the standard of HTTP methods,  GET, POST, DELETE, and SEND
It uses JSON or XML to transfer information

Which of the following is the entry area for Magento Admin?

index.php
default.php
frontend.php    
None of the above

Which of the following piece of codes can be used to get Magento clients by payment method?

$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*')->addFieldToFilter('method', "mundipagg_boleto");
  foreach ($collection as $orderPayment) {
      $orderId = $orderPayment->getParentId();
      $order = Mage::getModel('sales/order')->load($orderId);
      $customerId = $order->getCustomerId();
  }

$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*');
  foreach ($collection as $method) {
      if ($method->getMethod() == "mundipagg_boleto") {
           print $method->getMethod()."<br>";
      }
  }

$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*')->addField('method', "mundipagg_boleto");;
  foreach ($collection as $method) {
      if ($method->getMethod() == "mundipagg_boleto") {
           print $method->getMethod()."<br>";
      }
  }

All of the above

Which of the following files does Magento use to detect maintenance mode?

var/.maintenance.flag
var/.maintenance.mg
var/.maintenance
None of the above

What is required for Installing Magento Extensions on a Custom Theme?

<current theme package>  -->  <current theme folder>
<current theme package>  -->  <default folder in current theme's package>
base  -->  default folder
All of the above

The data model is based on the Entity-attribute-value _____ that stores data objects in tree structures?

rendering
model
class
modal

Which of the following is not a Magento cache type?

Configuration
Page cache
Entity attribute value (EAV)
DML
DDL

Static __ is a silent function of a class, which is stored in the memory space of a class (not objects)?

variable
function
page
method

Which code is used to specify JavaScript resources mapping?

var config = {
    paths: {
        // configuration for resource 'app/code/Magento/Catalog/controller/frontend/product/product.js'
        "product": "./product/product"
    }
};

var config = {
    paths: {
        // configuration for resource 'app/code/Magento/Catalog/view/frontend/product/product.js'
        "product": "./product/product"
    }
};

var config = {
    paths: {
        // configuration for resource 'app/code/Magento/Catalog/model/frontend/product/product.js'
        "product": "./product/product"
    }
};

var config = {
    paths: {
        // configuration for resource 'app/code/Magento/Catalog/js/frontend/product/product.js'
        "product": "./product/product"
    }
};

What is the difference between subtotal price and base subtotal?

Base subtotal is in the customer's currency and subtotal is in your shop's base currency
Subtotal in the customer's currency and base subtotal is in your shop's base currency
Subtotal includes taxes, base subtotal does not
Nothing special, it’s the same value

Which of the following are inappropriate dependencies?

Circular dependencies (both direct and indirect)
Undeclared dependencies
Incorrect dependencies
All of the above

To create a base grid block you need to define the following function?

getMassactionBlock()
_prepareMassactions()
_prepareMassaction()
getMassactionBlocks()

Which endpoint is used for user authorization(Customer)?

./oauth/initiate
./oauth/authorize
./admin/oauth_authorize
./oauth/token

Which endpoint is used for user authorization(Admin)?

./oauth/initiate
./oauth/authorize
./admin/oauth_authorize
./oauth/token

What actions are performed in this code?
$model = Mage::getModel('your_module/model');
$model->load($id);
$model->setData('name', 'value');
$model->load($id);
$model->save();

Model data was loaded from the database and saved twice, because load() calls save() if any data was changed
Model data was loaded twice, but was not saved
Model data was loaded from the database twice and saved into the database with a new property value
Model data was loaded once, but was not saved.

Magento looks for configuration information for each module in that module’s /etc directory. Depending on the needs of your module, you might have the following configuration files at the top level of your module’s /etc directory?

data.xml, config.xml, di.xml, class.xml, webapi.xml
run.xml, config.xml, dt.xml, module.xml, settings.xml
acl.xml, config.xml, di.xml, module.xml, webapi.xml
acl.xml, options.xml, mod.xml, web.xml, api.xml

Which code is used to get the Total Price of items currently in the cart?

helper(‘checkout’)->formatPrice(Mage::getSingleton(‘checkout/cart’)->getPrice()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrice(Mage::getSingleton({‘checkout/cart’})->getQuotes()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrice(Mage::getSingleton(‘checkout/cart’)->getQuote()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrices(Mage::getSingletons(‘checkout/cart’)->getQuote()->getGrandTotal()); ?>

When we are using .htaccess, how can you redirect all admin pages in Magento to another domain and subdirectory?

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_URI} !admin
RewriteCond %{REQUEST_URI} !index.php [NC]
RewriteRule ^ http://www.example.com/landing [R=302,L]

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/admin [NC]
RewriteRule ^ - [L]
RewriteCond %{THE_REQUEST} !/new/ [NC]
RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L]

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/admin [NC]
RewriteRule ^ - [L]
RewriteCond %{THE_REQUEST} !/new/ [NC]
RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L]

All of the above

Which of the following PHP extensions are required for installing Magento?

curl
intl
mhash
PDO/MySQL
All of the above.

Which inventory API allows you to retrieve the list of stock data by product IDs?
which inventory API allows you to reterive the list of stock data by product ids?

cataloginventory_stock_item.list()
cataloginventory_stock_item.update()
cataloginventory_stock_item.find()
All of the above

How can you disable a Magento Extension if you don't have access to admin section?

Change the <active> tag's value from true to false in module control file in app/etc/modules
Change the <active> tag's value from true to false in module control file in doc root of Magento
Both of the above
None of the above

Which of the following specifies the PHP class to use for the interface Magento\Customer\Api\CustomerRepositoryInterface?

di.xml
config.xml
custom.xml
None of the above

Which of the following is not a Magento module?

Core Modules
Community Modules
Commercial Modules
Complex Modules

A gift registry will hold the following informations?
Note: There may be more than one right answer.

List of products
Event location
Event name
Event id

Which relationship is not possible between two modules?

uses
reacts to
customizes
moves
replaces

When you want to change the behavior of the Magento core modules, which of the following method is acceptable?

Patching the core files.
Overriding a class by XML rewrite.
Move core modules into local directory and apply your changes.
Overriding a class by copying the core file to a local directory.

How many code pools does magento have?

1
2
3
4

which code is used to specify javascript resources maping?

Var config={
paths:{
//configuration for resources ‘app/code/magento/catalog/controller/frontend/product/product.js’
“product”:”./product/product”
}
};

Var config={
paths:{
//configuration for resources ‘app/code/magento/catalog/view/frontend/product/product.js’
“product”:”./product/product”
}
};

Var config={
paths:{
//configuration for resources ‘app/code/magento/catalog/model/frontend/product/product.js’
“product”:”./product/product”
}
};

Var config={
paths:{
//configuration for resources ‘app/code/magento/catalog/js/frontend/product/product.js’
“product”:”./product/product”
}
};

Which code is used  to include CMS block in template file(.phtml)?

echo $this->getLayout()->createBlock(‘cms/block’)->setBlockhtml(‘static_block_id’)->toHTML();
echo $this->getLayout()->createBlockHTML(‘cms/block’)->setBlockId(‘static_block_id’)->toHTML();
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘static_block_id’)->toPHTML();
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘static_block_id’)->toHTML();

Which action should you perform to make it possible to display your custom attribute value on the product list?

Set "used_in_product_listing" property for this attribute to "1".
Rewrite the method Mage_Catalog_Block_Product_List::_getProductCollection() to add additional attributes to select.
Observe the "catalog_product_collection_load_before" event to add the attribute to select.
You can use "used_in_product_list" property for this attribute to "0".

Which Magento command is used to display the current deployment mode?

magento deploy:mode
magento mode:show
magento deploy:mode:show
None of the above

which option are correct about optimize magento configuration?

To speed up magento performance ,don’t run mysql and web server on the same machine
Do not host files on your web server that you do not use
Optmization of session storage ,identification and disabling of unused magento modules
Enabling Magento flat catalog. (Magento uses a complex and resource-intensive Entity Attribute Value [or EAV] based catalog). After initial catalog establishment, enabling the flat catalog can dramatically improve database querying time.
All of the above

How do you change an order status to complete?

Directly in the database
By clicking Complete button
You need to create shipping for order
You need to create an invoice and shipping

What function do we use to filter a product collection?

addFieldToFilter ().
addAttributeToFilter().
addWhere().
filterByField().

What function fits in this code snippet?
class Namespace_Module_Block_Content extends Mage_Core_Block_Template {
 protected function _construct() {
      parent::_construct();
           $this->[function] ('namespace/module/content.phtml');
 }
}

setTemplate
setView
setViewFile
setLayout

which statement is false about a service contact?

It enables magento and third party devlopers to report sytem dependent through composer json file and consequently guarantee compatibility among magento version
A service contact includes data interfaces which preserve data integrity ,and services interfaces
Which hide business logic details from service requestors such as controllers web services and other modules .
Magento is modular system that enables third party developers to customize and overwrite core parts of its frame works this flexibility comes for free
Aservices contact is set of php interfaces that are defined for a module .

which theme file define the location of information in magento 2.0?

Signup.php
Registration.php
new.php
frontend.php

The controller action _____ method is called each time before calling the action method itself?

preDispatch
preAction
beforeDispatch
beforeAction

which of the following is not vailed for service layer?

Reside below the domain layer and above the presentation layer .
Contain services contracts which define how the implementation will behave .
Provide an easy way to access the REST/SOAP API framework code.
Provide a stable a API for other modules to call into.

Who uses the presentation layer?

Web users
System administrators
Web API calls
All of the above

What is the purpose of the FLAG_NO_REDIRECT_URL controller flag?

It does not perform a redirection
It does not redirect to an external URL
It does not redirect to an external URL, but allows internal forwarding
There is no such flag in Magento controllers

Which of the following code snippets changes the position of the compare products block in the right column?

<reference name="right">
   <action method="unsetChild">
     <block>catalog.compare.sidebar</block>
   </action>
   <action method="insert">
     <block>catalog.compare.sidebar</block>
     <sublingName>right.permanent.callout</sublingName>
     <after>1</after>
   </action>
</reference>

<reference name="right">
   <action method="move">
     <block>catalog.compare.sidebar</block>
     <sublingName>right.permanent.callout</sublingName>
     <after>1</after>
   </action>
</reference>

<action method="move" block="right">
   <block>catalog.compare.sidebar</block>
   <sublingName>right.permanent.callout</sublingName>
   <after>1</after>
</action>

<action method="copy" block="right">
   <block>catalog.compare.sidebar</block>
   <sublingName>right.permanent.callout</sublingName>
   <after>1</after>
</action>
<action method="remove" block="right">
   <block>catalog.compare.sidebar</block>
</action>

What does the following tag mean in module's config.xml file?
<sallowspecific>0</sallowspecific>

allow all available countries
allow all countries specified in the country list
shipping not allowed
None of the above

Which of the following is not a Magento product type?

Simple Product
Complex Product
Grouped Product
Configurable Product
Virtual Product

What function renders a Magento block?

_renderBlock
_toHtml
_render
_echoContents

If module A declares a dependency upon Module B, which of the following is not valid to declare such dependency?

In Module A's module.xml file, Module B is listed in the <sequence> list
declare a dependency upon Module B in A's composer.json
declare a dependency upon Module A in B's composer.json
in the deployment configuration, Modules A and B must both be defined as enabled.

What is stored in the var directory?

Various temporary data, such as log, cache and session files.
Variable values that are shared with third-party systems.
Variable values that are defined for Magento configuration.
Variable values for email templates.

Which statement correctly describes order state and order status?

State and status are independent properties of the order.
An order doesn't have a status, only a state. Status is a property of an invoice, shipment, and credit memo.
State represents the general state of the order, while status works on item level.
The status is a child of the state.

How can you access the Magento theme directory?

Mage::getSingleton('core/design_package')->getSkinBaseDir()
Mage::getBaseDir('skin');
$this->getSkinUrl()
All of the above

What model property is responsible for the naming of this event: "catalog_product_after_load"?

$_eventName property
$_eventDataKey property
$_eventObject property
$_eventPrefix property

 What method do you use to check if the model's property was changed?

isChanged($field);
dataHasChangedFor($field);
hasChanged($field);
isDifferent($field);

Which of the following is not true about flat catalog?

A flat catalog creates new tables on the fly
A flat catalog is updated manually
Flat catalog indexing also applies to catalog and shopping cart price rules
None of the above

How do you forward to a specific external URL outside Magento from your controller?

_forward ($url)
_redirectUrl ($url)
rewriteUrl($url)
goto($url)

Which command runs Magento cron jobs?

magento cron
magento cron:run
magento run
None of the above

You need to create a new product attribute that can be retrieved from order item on the order view page. What you are going to do to make it possible?

Create an observer for the order item collection after load event that will load the product collection with this attribute value
Create an observer for the order item collection after load event that will load the product model for each order item
Create the attribute for quote item and order item that will be fulfilled during the checkout process by Magento automatically
Create the attribute for quote item and order item, then define mapping of its value from quote item to order item and set it to quote item from product by observing event

A SOAP request is basically an HTTP POST request containing a SOAP ____ a ____ and a ____?

javascript, header , body
envelope, header , document
envelope, body , document
envelope, header , body

Which of the following tasks can be performed by Command Line Interface?

Installing Magento
Clearing the cache
Managing indexes, including reindexing
Creating translation dictionaries and translation packages
All of the above

Which PHP framework does Magento use?

Yii
Symfony
Zend
Lavarel

Domain layer code in one module can also plug itself into another module by:

plugins
di.xml files (with an SPI contract)
event hooks
All of the above

Which of the routes define the HTTP route for the web API method?
Note: There may be more than one right answer.

method
class
secure
All of the above

What is the correct XML path for setting a module’s setup connection?

config/global/resource/{$module}_setup
config/frontend/resources/{$module}_setup
config/frontend/resources/setup/{$module}
config/general/resources/setup/{$module}  ?

Which of the following is not valid for service layer?

Resides below the domain layer and above the presentation layer.
Contains service contracts, which define how the implementation will behave.
Provides an easy way to access the REST/SOAP API framework code.
Provides a stable API for other modules to call into.

Who accesses the service layer?

Controllers (initiated by actions of users of the storefront)
Web services (SOAP and REST API calls)
Magento modules through service contracts
All of the above

How can we disable magento extension for a particular page?

cms_index_index>
  <reference name="footer">
    <disable name="newsletter"/>
  </reference>
</cms_index_index>

cms_index_index>
  <reference name="footer">
    <disable_extension name="newsletter"/>
  </reference>
</cms_index_index>

cms_index_index>
  <reference name="footer">
    <remove name="newsletter"/>
  </reference>
</cms_index_index>

All of the above

Which theme file defines the location information in Magento 2.0?

signup.php
registration.php
new.php
frontend.php

Which options are correct about Optimize Magento Configuration?

To speed up Magento performance, don't run mysql and web server on the same machine.
Do not host files on your web server that you do not use.
Optimization of session storage, Identification and disabling of unused Magento modules.
Enabling Magento flat catalog. (Magento uses a complex and resource-intensive Entity Attribute Value [or EAV] based catalog). After initial catalog establishment, enabling the flat catalog can dramatically improve database querying time.
All of the above

How can you get Magento extension to run javascript when an item is added to the cart?

<checkout_cart_product_add_after>
    <reference name="footer">
        <block type="core/templates" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
    </reference>
</checkout_cart_product_add_after>

<catalog_product_view>
    <reference name="footer">
        <block type="core/template" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
    </reference>
</catalog_product_view>

<checkout_cart_product_add_after>
    <reference name="footer">
        <block type="core/template" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
    </reference>
</checkout_cart_product_add_after>

All of the above

Magento Test Upwork 2019