コード例 #1
0
 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     $newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', FALSE);
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
コード例 #2
0
 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     /** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
     $newWorkspace = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace')->disableOriginalConstructor()->getMock();
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
コード例 #3
0
 /**
  * @test
  */
 public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
 {
     /** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
     $newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', false);
     $this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
     $this->nodeData->setWorkspace($newWorkspace);
     $this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
 }
コード例 #4
0
ファイル: Node.php プロジェクト: radmiraal/TYPO3.TYPO3CR
 /**
  * Sets the workspace of this node.
  *
  * This method is only for internal use by the content repository. Changing
  * the workspace of a node manually may lead to unexpected behavior.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\Workspace $workspace
  * @return void
  */
 public function setWorkspace(Workspace $workspace)
 {
     if (!$this->isNodeDataMatchingContext()) {
         $this->materializeNodeData();
     }
     $this->nodeData->setWorkspace($workspace);
     $this->context->getFirstLevelNodeCache()->flush();
     $this->emitNodeUpdated($this);
 }