Beispiel #1
0
 /**
  * @test
  */
 public function removeAttachmentFromObjectStorageHoldingAttachment()
 {
     $attachment = new Tx_Nxshowroom_Domain_Model_Attachment();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($attachment);
     $localObjectStorage->detach($attachment);
     $this->fixture->addAttachment($attachment);
     $this->fixture->removeAttachment($attachment);
     $this->assertEquals($localObjectStorage, $this->fixture->getAttachment());
 }
 /**
  * action create
  *
  * @param $newAttachment
  * @param Tx_Nxshowroom_Domain_Model_Resource $resource
  * @return void
  */
 public function createAction(Tx_Nxshowroom_Domain_Model_Attachment $newAttachment, Tx_Nxshowroom_Domain_Model_Resource $resource)
 {
     $this->attachmentRepository->add($newAttachment);
     $resource->addAttachment($newAttachment);
     $this->flashMessageContainer->add('Your new Attachment was created.');
     $this->redirect('show', 'Resource', NULL, array('resource' => $resource->getUid()));
 }