Ejemplo n.º 1
0
 public function testGetUriWithAndWithoutFilename()
 {
     $filename = "My File.png";
     $this->target->setName($filename);
     $this->assertSame($this->target->getUri(), '/file/Organizations.OrganizationImage/' . $this->target->getId() . '/' . urlencode($this->target->getName()));
     $this->target->setName(null);
     $this->assertSame($this->target->getUri(), '/file/Organizations.OrganizationImage/' . $this->target->getId());
 }
Ejemplo n.º 2
0
 /**
  * @covers ::store
  * @covers ::getImagePath
  * @covers ::createDirectoryRecursively
  * @expectedException \RuntimeException
  * @expectedExceptionMessage unable to create directory
  */
 public function testStoreWithInsufficientPermissions()
 {
     $image = new ImageEntity();
     $image->setId('someId');
     $image->setName('filename.ext');
     vfsStreamWrapper::getRoot()->chmod(00);
     $this->manager->store($image);
 }