PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\ContentTest::testRichTextRunLanguage PHP Method

testRichTextRunLanguage() public method

    public function testRichTextRunLanguage()
    {
        $oPhpPresentation = new PhpPresentation();
        $oSlide = $oPhpPresentation->getActiveSlide();
        $oRichText = $oSlide->createRichTextShape();
        $oRun = $oRichText->createTextRun('MyText');
        $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
        $expectedElement = '/office:document-content/office:automatic-styles/style:style[@style:name=\'T_' . $oRun->getHashCode() . '\']/style:text-properties';
        $this->assertTrue($pres->elementExists($expectedElement, 'content.xml'));
        $this->assertTrue($pres->attributeElementExists($expectedElement, 'fo:language', 'content.xml'));
        $this->assertEquals('en-US', $pres->getElementAttribute($expectedElement, 'fo:language', 'content.xml'));
        $oRun->setLanguage('de_DE');
        $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
        $expectedElement = '/office:document-content/office:automatic-styles/style:style[@style:name=\'T_' . $oRun->getHashCode() . '\']/style:text-properties';
        $this->assertTrue($pres->elementExists($expectedElement, 'content.xml'));
        $this->assertTrue($pres->attributeElementExists($expectedElement, 'fo:language', 'content.xml'));
        $this->assertEquals('de_DE', $pres->getElementAttribute($expectedElement, 'fo:language', 'content.xml'));
    }