Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RobotsTest.php
Go to the documentation of this file.
1 <?php
7 
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',
46  )
47  ->willReturn($customInstructions);
48 
49  $this->assertEquals($customInstructions, $this->model->getData());
50  }
51 }