Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StagingTest.php
Go to the documentation of this file.
1 <?php
11 
12 class StagingTest extends \PHPUnit\Framework\TestCase
13 {
18  public function testUpdateFromStagingTheme()
19  {
20  $parentTheme = $this->createMock(\Magento\Theme\Model\Theme::class);
21 
22  $theme = $this->createPartialMock(\Magento\Theme\Model\Theme::class, ['__wakeup', 'getParentTheme']);
23  $theme->expects($this->once())->method('getParentTheme')->will($this->returnValue($parentTheme));
24 
25  $themeCopyService = $this->createPartialMock(\Magento\Theme\Model\CopyService::class, ['copy']);
26  $themeCopyService->expects($this->once())->method('copy')->with($theme, $parentTheme);
27 
28  $object = new \Magento\Theme\Model\Theme\Domain\Staging($theme, $themeCopyService);
29  $this->assertSame($object, $object->updateFromStagingTheme());
30  }
31 }
$theme