Newscoop\Entity\Attachment::setExtension PHP Метод

setExtension() публичный Метод

Sets the value of extension.
public setExtension ( string $extension ) : self
$extension string the extension
Результат self
    public function setExtension($extension)
    {
        $this->extension = $extension;
        return $this;
    }

Usage Example

 public function it_should_return_path_for_attachment()
 {
     $this->getStorageLocation(new Attachment())->shouldBe(realpath(__DIR__ . '/../../../newscoop/public/files') . '/0000/0000/000000000');
     $attachment = new Attachment();
     $attachment->setExtension('pdf')->setId(34);
     $this->getStorageLocation($attachment)->shouldBe(realpath(__DIR__ . '/../../../newscoop/public/files') . '/0000/0000/000000034.pdf');
 }