PhpOffice\PhpPresentation\Shape\RichText\TextElement::setHyperlink PHP Method

    public function setHyperlink(Hyperlink $pHyperlink = null)
    {
        $this->hyperlink = $pHyperlink;
        return $this;
    }

Usage Example

コード例 #1
0
 public function testHyperlink()
 {
     $object = new TextElement();
     $this->assertFalse($object->hasHyperlink());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setHyperlink());
     $this->assertFalse($object->hasHyperlink());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink());
     $this->assertTrue($object->hasHyperlink());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setHyperlink(new Hyperlink('http://www.google.fr')));
     $this->assertTrue($object->hasHyperlink());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink());
 }