/**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->document = new Document();
     $this->document->setId(1);
     $this->document->setDocument('This is the document');
     $contentType = new ContentType();
     $contentType->setExtension('.xyz');
     $this->document->setContentType($contentType);
     $project = new Project();
     $project->setId(1);
     $project->setNumber('1234');
     $project->setProject('This is the number');
     $workpackage = new Workpackage();
     $workpackage->setSequence(1);
     $workpackage->setProject($project);
     $this->document->setWorkpackage($workpackage);
     $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock();
     $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true));
     $viewHelperManager = $this->serviceManager->get('viewhelpermanager');
     $viewHelperManager->setService('isAllowed', $authorizeServiceMock);
     $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock();
     $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true));
     $viewHelperManager->setService('url', $urlViewHelperMock);
     $this->documentLink = $viewHelperManager->get('workpackageDocumentlink');
 }
Beispiel #2
0
 /**
  * @return array
  */
 public function provider()
 {
     $contentType = new ContentType();
     $contentType->setContentType('test/' . Rand::getString(12));
     $contentType->setDescription('This is the description ' . Rand::getString(12));
     $contentType->setExtension(Rand::getString(4));
     return [[$contentType]];
 }
Beispiel #3
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->ideaImage = $this->serviceManager->get('viewhelpermanager')->get('ideaImage');
     $idea = new Idea();
     $idea->setId(1);
     $idea->setIdea('This is the idea');
     $this->image = new Image();
     $this->image->setId(1);
     $this->image->setIdea($idea);
     $contentType = new ContentType();
     $contentType->setExtension('jpg');
     $this->image->setContentType($contentType);
 }