/** * @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); }
/** * @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()); }