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());
 }
Exemple #2
0
 /**
  * @covers ::__construct
  * @covers ::getUri
  * @covers ::getImageSubPath
  */
 public function testGetUri()
 {
     $id = 'someId';
     $image = new ImageEntity();
     $image->setId($id);
     $image->setName('filename.ext');
     $this->options->setEnabled(false);
     $this->assertEquals($image->getUri(), $this->manager->getUri($image));
     $this->options->setEnabled(true);
     $cachedUri = $this->manager->getUri($image);
     $this->assertNotEquals($image->getUri(), $cachedUri);
     $this->assertContains($this->options->getUriPath(), $cachedUri);
 }