Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ProductUrlRewriteTest.php
Go to the documentation of this file.
1 <?php
7 
12 
17 {
21  protected $scopeConfigMock;
22 
23  protected function setUp()
24  {
25  parent::setUp();
26  $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
27  ->getMockForAbstractClass();
28  }
29 
33  protected function createModel()
34  {
35  return $this->objectManager->getObject(ProductUrlRewrite::class, [
36  'locator' => $this->locatorMock,
37  'arrayManager' => $this->arrayManagerMock,
38  'scopeConfig' => $this->scopeConfigMock,
39  ]);
40  }
41 
42  public function testModifyMeta()
43  {
44  $this->assertSame([], $this->getModel()->modifyMeta([]));
45 
46  $this->productMock->expects($this->any())
47  ->method('getId')
48  ->willReturn(1);
49 
50  $this->assertNotEmpty($this->getModel()->modifyMeta([
51  'test_group_code' => [
52  'children' => [
54  'label' => 'label',
55  'scopeLabel' => 'scopeLabel',
56  ],
57  ],
58  ],
59  ]));
60  }
61 
62  public function testModifyData()
63  {
64  $this->assertSame($this->getSampleData(), $this->getModel()->modifyData($this->getSampleData()));
65  }
66 }