Ejemplo n.º 1
0
 /**
  * @testdox getUri() urlencodes the file name
  */
 public function testGetUriUsesUrlEncodeToEncodeTheFileName()
 {
     $name = 'Name-with /%& $#criticalCharacters';
     $this->target->setName($name);
     $expected = sprintf($this->uriSpec, urlencode($name));
     $notExpected = sprintf($this->uriSpec, $name);
     $actual = $this->target->getUri();
     $this->assertEquals($expected, $actual);
     $this->assertNotEquals($notExpected, $actual);
 }
Ejemplo n.º 2
0
 /**
  * @covers Applications\Entity\Application::getAttachments
  * @covers Applications\Entity\Application::setAttachments
  */
 public function testSetGetAttachments()
 {
     $attachment = new Attachment();
     $attachment->setName('foo');
     $attachments = new ArrayCollection();
     $attachments->add($attachment);
     $this->target->setAttachments($attachments);
     $this->assertEquals($attachments, $this->target->getAttachments());
 }