Added text align test

This commit is contained in:
Gabriel Bull 2014-02-12 13:28:35 -05:00
parent 334422d04e
commit f76a9cdbed
2 changed files with 28 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class PageNumberingTest extends PHPUnit_Framework_TestCase
TestHelper::clear();
}
public function testImageWrappingStyleBehind()
public function testSectionPageNumbering()
{
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();

View File

@ -0,0 +1,27 @@
<?php
namespace PHPWord\Tests\Text;
use PHPUnit_Framework_TestCase;
use PHPWord;
use PHPWord\Tests\TestHelper;
class AlignTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
TestHelper::clear();
}
public function testAlign()
{
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
$section->addText('This is my text', null, array('align' => 'right'));
$doc = TestHelper::getDocument($PHPWord);
$element = $doc->getElement('/w:document/w:body/w:p/w:pPr/w:jc');
$this->assertEquals('right', $element->getAttribute('w:val'));
}
}