Add unit tests for refactoring results
This commit is contained in:
parent
07be5eaea3
commit
6f7b97e3ab
|
|
@ -39,14 +39,14 @@ class DocumentProperties
|
|||
/**
|
||||
* Created
|
||||
*
|
||||
* @var datetime|int
|
||||
* @var int
|
||||
*/
|
||||
private $_created;
|
||||
|
||||
/**
|
||||
* Modified
|
||||
*
|
||||
* @var datetime|int
|
||||
* @var int
|
||||
*/
|
||||
private $_modified;
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ class DocumentProperties
|
|||
/**
|
||||
* Get Created
|
||||
*
|
||||
* @return datetime
|
||||
* @return int
|
||||
*/
|
||||
public function getCreated()
|
||||
{
|
||||
|
|
@ -181,7 +181,7 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Created
|
||||
*
|
||||
* @param datetime $pValue
|
||||
* @param int $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setCreated($pValue = null)
|
||||
|
|
@ -196,7 +196,7 @@ class DocumentProperties
|
|||
/**
|
||||
* Get Modified
|
||||
*
|
||||
* @return datetime
|
||||
* @return int
|
||||
*/
|
||||
public function getModified()
|
||||
{
|
||||
|
|
@ -206,7 +206,7 @@ class DocumentProperties
|
|||
/**
|
||||
* Set Modified
|
||||
*
|
||||
* @param datetime $pValue
|
||||
* @param int $pValue
|
||||
* @return \PhpOffice\PhpWord\DocumentProperties
|
||||
*/
|
||||
public function setModified($pValue = null)
|
||||
|
|
|
|||
|
|
@ -30,5 +30,6 @@ class FootnoteTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals(1, $rIdFootnote);
|
||||
$this->assertEquals(1, $rIdLink);
|
||||
$this->assertEquals(1, count(Footnote::getFootnoteElements()));
|
||||
$this->assertEquals(1, count(Footnote::getFootnoteLinkElements()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,8 @@ class MediaTest extends \PHPUnit_Framework_TestCase
|
|||
Media::addHeaderMediaElement(1, $remote, new Image($remote));
|
||||
|
||||
$this->assertEquals(2, Media::countHeaderMediaElements('header1'));
|
||||
$this->assertEquals(2, count(Media::getMediaElements('header1')));
|
||||
$this->assertFalse(Media::getMediaElements('header2'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use PhpOffice\PhpWord\Settings;
|
|||
class SettingsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Get and set compatibity option
|
||||
* Get/set compatibity option
|
||||
*/
|
||||
public function testGetSetCompatibility()
|
||||
{
|
||||
|
|
@ -28,4 +28,14 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertFalse(Settings::getCompatibility());
|
||||
$this->assertFalse(Settings::setCompatibility('Non boolean'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/set zip class
|
||||
*/
|
||||
public function testGetSetZipClass()
|
||||
{
|
||||
$this->assertEquals(Settings::ZIPARCHIVE, Settings::getZipClass());
|
||||
$this->assertTrue(Settings::setZipClass(Settings::PCLZIP));
|
||||
$this->assertFalse(Settings::setZipClass('foo'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue