Beispiel #1
0
 protected function setUp()
 {
     $this->mapper = $this->getMock('Sulu\\Component\\Content\\Types\\Rlp\\Mapper\\RlpMapper', [], ['test-mapper'], 'TestMapper');
     $this->mapper->expects($this->any())->method('unique')->will($this->returnCallback([$this, 'uniqueCallback']));
     $this->mapper->expects($this->any())->method('getUniquePath')->will($this->returnCallback([$this, 'getUniquePathCallback']));
     $this->mapper->expects($this->any())->method('save')->will($this->returnCallback([$this, 'saveCallback']));
     $this->mapper->expects($this->any())->method('move')->will($this->returnCallback([$this, 'moveCallback']));
     $this->mapper->expects($this->any())->method('loadByContent')->will($this->returnValue('/test'));
     $this->mapper->expects($this->any())->method('loadByContentUuid')->will($this->returnValue('/test'));
     $this->mapper->expects($this->any())->method('loadByResourceLocator')->will($this->returnValue('this-is-a-uuid'));
     $this->mapper->expects($this->any())->method('getParentPath')->will($this->returnValue('/parent'));
     $structureManager = $this->getMockForAbstractClass('Sulu\\Component\\Content\\Compat\\StructureManagerInterface');
     $contentTypeManager = $this->getMockForAbstractClass('Sulu\\Component\\Content\\ContentTypeManagerInterface');
     $nodeHelper = $this->getMock('Sulu\\Component\\Util\\SuluNodeHelper', [], [], '', false);
     $this->strategy = $this->getMockForAbstractClass($this->className, ['test-strategy', $this->mapper, new PathCleanup(), $structureManager, $contentTypeManager, $nodeHelper], 'TestStrategy');
     $this->strategy->expects($this->any())->method('generatePath')->will($this->returnCallback([$this, 'generateCallback']));
 }