public function testIcon() { $authorNoIcon = new Author('J.R.R. Tolkien'); $this->assertFalse($authorNoIcon->hasIcon()); $icon = new Url('https://upload.wikimedia.org/wikipedia/commons/7/7e/George_Orwell_press_photo.jpg'); $authorIcon = new Author('George Orwell', null, $icon); $this->assertTrue($authorIcon->hasIcon()); $this->assertEquals($icon, $authorIcon->getIcon()); }
/** * The author parameters will display a small section at the top of a message attachment. * * @param Author $author * * @return self */ public function setAuthor(Author $author) { $this->attachment['author_name'] = $author; if ($author->hasIcon()) { $this->attachment['author_icon'] = $author->getIcon(); } if ($author->hasLink()) { $this->attachment['author_link'] = $author->getLink(); } return $this; }