/** * @test */ public function setAndGetCopyrightFromParentVideo() { $parentVideo = new Video(); $parentVideo->setCopyright('Copyright from parent video'); $this->subject->setParentid($parentVideo); self::assertSame('Copyright from parent video', $this->subject->getCopyright()); }
/** * @return string */ public function getCopyright() { if ($this->copyright) { return $this->copyright; } elseif ($this->parentid instanceof self) { return $this->parentid->getCopyright(); } return $this->copyright; }