コード例 #1
0
ファイル: WebsiteTest.php プロジェクト: Doability/magento2dev
 public function testIsCanDelete()
 {
     $websiteCollection = $this->getMock('Magento\\Store\\Model\\ResourceModel\\Website\\Collection', ['getSize'], [], '', false);
     $websiteCollection->expects($this->any())->method('getSize')->will($this->returnValue(2));
     $this->websiteFactory->expects($this->any())->method('create')->willReturn($this->websiteFactory);
     $this->websiteFactory->expects($this->any())->method('getCollection')->willReturn($websiteCollection);
     $this->model->setId(2);
     $this->assertTrue($this->model->isCanDelete());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function isCanDelete()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isCanDelete');
     if (!$pluginInfo) {
         return parent::isCanDelete();
     } else {
         return $this->___callPlugins('isCanDelete', func_get_args(), $pluginInfo);
     }
 }
コード例 #3
0
ファイル: WebsiteTest.php プロジェクト: aiesh/magento2
 public function testIsCanDelete()
 {
     $this->assertFalse($this->_model->isCanDelete());
     $this->_model->isReadOnly(true);
     $this->assertFalse($this->_model->isCanDelete());
 }