PHPWord/test/PhpWord/Writer/ODText/WriterPartTest.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2014-03-16 07:40:02 +07:00
<?php
namespace 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
/**
* Class WriterPartTest
*
* @package PhpWord\Tests
* @coversDefaultClass 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();
}
}