Beispiel #1
0
 public function testRemove()
 {
     $id = 'test_id';
     $this->layoutManipulator->expects($this->once())->method('remove')->with($id);
     $result = $this->layoutBuilder->remove($id);
     $this->assertSame($this->layoutBuilder, $result);
 }
 /**
  * @test
  */
 public function findByParentAndNodeTypeRemovesRemovedNodeInRepositoryAndRespectsWorkspaceAndDimensions()
 {
     $liveWorkspace = new Workspace('live');
     $nodeData = $this->getMockBuilder(NodeData::class)->disableOriginalConstructor()->getMock();
     $nodeData->expects($this->any())->method('getIdentifier')->will($this->returnValue('abcd-efgh-ijkl-mnop'));
     $nodeData->expects($this->any())->method('getPath')->will($this->returnValue('/foo/bar'));
     $nodeData->expects($this->any())->method('getDepth')->will($this->returnValue(2));
     $this->nodeDataRepository->remove($nodeData);
     $dimensions = array('persona' => array('everybody'), 'language' => array('de_DE', 'mul_ZZ'));
     $nodeData->expects($this->atLeastOnce())->method('matchesWorkspaceAndDimensions')->with($liveWorkspace, $dimensions)->will($this->returnValue(true));
     $this->nodeDataRepository->expects($this->any())->method('getNodeDataForParentAndNodeType')->will($this->returnValue(array('abcd-efgh-ijkl-mnop' => $nodeData)));
     $result = $this->nodeDataRepository->findByParentAndNodeType('/foo', null, $liveWorkspace, $dimensions);
     $this->assertCount(0, $result);
 }
Beispiel #3
0
 /**
  * @test
  * @expectedException \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
  */
 public function removeChecksObjectType()
 {
     $this->repository->_set('objectType', 'ExpectedObjectType');
     $this->repository->remove(new \stdClass());
 }
 public function tearDown()
 {
     $this->fs->remove($this->dir);
 }
 /**
  * @test
  *
  * @expectedException \BadMethodCallException
  */
 public function removeThrowsException()
 {
     $this->subject->remove(new AbstractEntity());
 }