PHPWord/tests/PhpWord/Tests/Writer/ODText/WriterPartTest.php

51 lines
1.3 KiB
PHP
Raw Normal View History

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
*/
namespace PhpOffice\PhpWord\Tests\Writer\ODText;
2014-03-16 07:40:02 +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(
'PhpOffice\\PhpWord\\Writer\\ODText\\WriterPart'
2014-03-16 07:40:02 +07:00
);
$object->setParentWriter(new ODText());
2014-03-16 07:40:02 +07:00
$this->assertEquals(
new ODText(),
2014-03-16 07:40:02 +07:00
$object->getParentWriter()
);
}
/**
* covers ::getParentWriter
* @expectedException Exception
* @expectedExceptionMessage No parent IWriter assigned.
2014-03-16 07:40:02 +07:00
*/
public function testSetGetParentWriterNull()
{
$object = $this->getMockForAbstractClass(
'PhpOffice\\PhpWord\\Writer\\ODText\\WriterPart'
2014-03-16 07:40:02 +07:00
);
$object->getParentWriter();
}
}