assertEquals('', $object->getText()); $object = new TextElement('AAA'); $this->assertEquals('AAA', $object->getText()); } public function testFont() { $object = new TextElement(); $this->assertNull($object->getFont()); } 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()); } public function testLanguage() { $object = new TextElement(); $this->assertNull($object->getLanguage()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setLanguage('en-US')); $this->assertEquals('en-US', $object->getLanguage()); } public function testText() { $object = new TextElement(); $this->assertEquals('', $object->getText()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText()); $this->assertEquals('', $object->getText()); $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText('AAA')); $this->assertEquals('AAA', $object->getText()); } /** * Test get/set hash index */ public function testHashCode() { $object = new TextElement(); $this->assertEquals(md5(get_class($object)), $object->getHashCode()); } }