2014-03-16 07:40:02 +07:00
|
|
|
<?php
|
2014-03-27 23:55:06 +07:00
|
|
|
/**
|
|
|
|
|
* PHPWord
|
|
|
|
|
*
|
|
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
|
|
|
|
* @copyright 2014 PHPWord
|
|
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
|
|
|
|
*/
|
2014-03-23 11:59:22 -04:00
|
|
|
namespace PhpOffice\PhpWord\Tests\Writer\ODText;
|
2014-03-16 07:40:02 +07:00
|
|
|
|
2014-03-23 17:37:26 +07:00
|
|
|
use PhpOffice\PhpWord\Writer\ODText;
|
|
|
|
|
use PhpWord\Tests\TestHelperDOCX;
|
2014-03-16 07:40:02 +07:00
|
|
|
|
|
|
|
|
/**
|
2014-03-27 23:55:06 +07:00
|
|
|
* Test class for PhpOffice\PhpWord\Writer\ODText\WriterPart
|
2014-03-16 07:40:02 +07:00
|
|
|
*
|
2014-03-27 23:55:06 +07:00
|
|
|
* @coversDefaultClass \PhpOffice\PhpWord\Writer\ODText\WriterPart
|
2014-03-16 07:40:02 +07:00
|
|
|
* @runTestsInSeparateProcesses
|
|
|
|
|
*/
|
|
|
|
|
class WriterPartTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* covers ::setParentWriter
|
|
|
|
|
* covers ::getParentWriter
|
|
|
|
|
*/
|
|
|
|
|
public function testSetGetParentWriter()
|
|
|
|
|
{
|
|
|
|
|
$object = $this->getMockForAbstractClass(
|
2014-03-23 17:37:26 +07:00
|
|
|
'PhpOffice\\PhpWord\\Writer\\ODText\\WriterPart'
|
2014-03-16 07:40:02 +07:00
|
|
|
);
|
2014-03-23 17:37:26 +07:00
|
|
|
$object->setParentWriter(new ODText());
|
2014-03-16 07:40:02 +07:00
|
|
|
$this->assertEquals(
|
2014-03-23 17:37:26 +07:00
|
|
|
new ODText(),
|
2014-03-16 07:40:02 +07:00
|
|
|
$object->getParentWriter()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* covers ::getParentWriter
|
|
|
|
|
* @expectedException Exception
|
2014-03-23 17:37:26 +07:00
|
|
|
* @expectedExceptionMessage No parent IWriter assigned.
|
2014-03-16 07:40:02 +07:00
|
|
|
*/
|
|
|
|
|
public function testSetGetParentWriterNull()
|
|
|
|
|
{
|
|
|
|
|
$object = $this->getMockForAbstractClass(
|
2014-03-23 17:37:26 +07:00
|
|
|
'PhpOffice\\PhpWord\\Writer\\ODText\\WriterPart'
|
2014-03-16 07:40:02 +07:00
|
|
|
);
|
|
|
|
|
$object->getParentWriter();
|
|
|
|
|
}
|
|
|
|
|
}
|