PhpOffice\PhpPresentation\Tests\Writer\ODPresentation\StylesTest::testStrokeDash PHP Метод

testStrokeDash() публичный Метод

public testStrokeDash ( )
    public function testStrokeDash()
    {
        $oPhpPresentation = new PhpPresentation();
        $oSlide = $oPhpPresentation->getActiveSlide();
        $oRichText1 = $oSlide->createRichTextShape();
        $oRichText1->getBorder()->setColor(new Color('FF4672A8'))->setLineStyle(Border::LINE_SINGLE);
        $arrayDashStyle = array(Border::DASH_DASH, Border::DASH_DASHDOT, Border::DASH_DOT, Border::DASH_LARGEDASH, Border::DASH_LARGEDASHDOT, Border::DASH_LARGEDASHDOTDOT, Border::DASH_SYSDASH, Border::DASH_SYSDASHDOT, Border::DASH_SYSDASHDOTDOT, Border::DASH_SYSDOT);
        foreach ($arrayDashStyle as $style) {
            $oRichText1->getBorder()->setDashStyle($style);
            $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
            $element = '/office:document-styles/office:styles/draw:stroke-dash[@draw:name=\'strokeDash_' . $style . '\']';
            $this->assertTrue($pres->elementExists($element, 'styles.xml'));
            $this->assertEquals('rect', $pres->getElementAttribute($element, 'draw:style', 'styles.xml'));
            $this->assertTrue($pres->attributeElementExists($element, 'draw:distance', 'styles.xml'));
            switch ($style) {
                case Border::DASH_DOT:
                case Border::DASH_SYSDOT:
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots1', 'styles.xml'));
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots1-length', 'styles.xml'));
                    break;
                case Border::DASH_DASH:
                case Border::DASH_LARGEDASH:
                case Border::DASH_SYSDASH:
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots2', 'styles.xml'));
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots2-length', 'styles.xml'));
                    break;
                case Border::DASH_DASHDOT:
                case Border::DASH_LARGEDASHDOT:
                case Border::DASH_LARGEDASHDOTDOT:
                case Border::DASH_SYSDASHDOT:
                case Border::DASH_SYSDASHDOTDOT:
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots1', 'styles.xml'));
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots1-length', 'styles.xml'));
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots2', 'styles.xml'));
                    $this->assertTrue($pres->attributeElementExists($element, 'draw:dots2-length', 'styles.xml'));
                    break;
            }
        }
    }