/**
  * @test
  *
  * @expectedException \Magento\Framework\Exception\CouldNotDeleteException
  */
 public function testDeleteException()
 {
     $this->pageResource->expects($this->once())->method('delete')->with($this->page)->willThrowException(new \Exception());
     $this->repository->delete($this->page);
 }
Exemple #2
0
 /**
  * Run test delete method
  *
  * @return void
  */
 public function testDelete()
 {
     $pageMock = $this->getMockForAbstractClass('Magento\\Cms\\Model\\Page', [], '', false, true, true, ['getPageId']);
     $this->resourceMock->expects($this->once())->method('delete')->with($pageMock);
     $this->assertTrue($this->pageRepository->delete($pageMock));
 }