示例#1
0
 /**
  * Get one of theme domain models
  *
  * @param int|null $type
  * @return \Magento\Theme\Model\Theme\Domain\Virtual|\Magento\Theme\Model\Theme\Domain\Staging
  * @throws \InvalidArgumentException
  */
 public function getDomainModel($type = null)
 {
     if ($type !== null && $type != $this->getType()) {
         throw new \InvalidArgumentException(sprintf('Invalid domain model "%s" requested for theme "%s" of type "%s"', $type, $this->getId(), $this->getType()));
     }
     return $this->_domainFactory->create($this);
 }
示例#2
0
 /**
  * @test
  * @return void
  */
 public function testGetDomainModel()
 {
     $result = 'res';
     $this->domainFactory->expects($this->once())->method('create')->with($this->_model)->willReturn($result);
     $this->assertEquals($result, $this->_model->getDomainModel());
 }