PHPWord/tests/PhpWord/Tests/Element/AbstractElementTest.php

40 lines
999 B
PHP
Raw Normal View History

<?php
/**
* PHPWord
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/lgpl.txt LGPL
*/
namespace PhpOffice\PhpWord\Tests\Element;
/**
2014-04-12 12:57:51 +07:00
* Test class for PhpOffice\PhpWord\Element\AbstractElement
*
* @runTestsInSeparateProcesses
*/
class AbstractElementTest extends \PHPUnit_Framework_TestCase
{
2014-04-12 10:23:31 +07:00
/**
* Test set/get element index
*/
public function testElementIndex()
{
$stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Element\AbstractElement');
$ival = rand(0, 100);
$stub->setElementIndex($ival);
$this->assertEquals($stub->getElementIndex(), $ival);
}
2014-04-12 12:57:51 +07:00
2014-04-12 10:23:31 +07:00
/**
* Test set/get element unique Id
*/
public function testElementId()
{
$stub = $this->getMockForAbstractClass('\PhpOffice\PhpWord\Element\AbstractElement');
$stub->setElementId();
$this->assertEquals(strlen($stub->getElementId()), 6);
}
}