Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-robots
Test
Unit
Model
RobotsTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Robots\Test\Unit\Model
;
7
8
use
Magento\Framework\App\Config\ScopeConfigInterface
;
9
use
Magento\Robots\Model\Robots
;
10
use
Magento\Store\Model\ScopeInterface
;
11
12
class
RobotsTest
extends
\PHPUnit\Framework\TestCase
13
{
17
private
$scopeConfigMock;
18
22
private
$model;
23
24
protected
function
setUp
()
25
{
26
$this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
27
->getMockForAbstractClass();
28
29
$this->model =
new
Robots
(
30
$this->scopeConfigMock
31
);
32
}
33
37
public
function
testGetData
()
38
{
39
$customInstructions =
'custom_instructions'
;
40
41
$this->scopeConfigMock->expects($this->once())
42
->method(
'getValue'
)
43
->with(
44
'design/search_engine_robots/custom_instructions'
,
45
ScopeInterface::SCOPE_WEBSITE
46
)
47
->willReturn($customInstructions);
48
49
$this->assertEquals($customInstructions, $this->model->getData());
50
}
51
}
Magento\Robots\Model\Robots
Definition:
Robots.php:14
Magento\Robots\Test\Unit\Model\RobotsTest
Definition:
RobotsTest.php:12
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Robots\Test\Unit\Model\RobotsTest\testGetData
testGetData()
Definition:
RobotsTest.php:37
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\Robots\Test\Unit\Model\RobotsTest\setUp
setUp()
Definition:
RobotsTest.php:24
Magento\Robots\Test\Unit\Model
Magento\Store\Model\ScopeInterface\SCOPE_WEBSITE
const SCOPE_WEBSITE
Definition:
ScopeInterface.php:23