Skip to content

Commit f76a9cd

Browse files
committed
Added text align test
1 parent 334422d commit f76a9cd

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

test/PHPWord/Tests/Section/PageNumberingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function tearDown()
1212
TestHelper::clear();
1313
}
1414

15-
public function testImageWrappingStyleBehind()
15+
public function testSectionPageNumbering()
1616
{
1717
$PHPWord = new PHPWord();
1818
$section = $PHPWord->createSection();

test/PHPWord/Tests/Text/AlignTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
namespace PHPWord\Tests\Text;
3+
4+
use PHPUnit_Framework_TestCase;
5+
use PHPWord;
6+
use PHPWord\Tests\TestHelper;
7+
8+
class AlignTest extends PHPUnit_Framework_TestCase
9+
{
10+
public function tearDown()
11+
{
12+
TestHelper::clear();
13+
}
14+
15+
public function testAlign()
16+
{
17+
$PHPWord = new PHPWord();
18+
$section = $PHPWord->createSection();
19+
20+
$section->addText('This is my text', null, array('align' => 'right'));
21+
22+
$doc = TestHelper::getDocument($PHPWord);
23+
$element = $doc->getElement('/w:document/w:body/w:p/w:pPr/w:jc');
24+
25+
$this->assertEquals('right', $element->getAttribute('w:val'));
26+
}
27+
}

0 commit comments

Comments
 (0)