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

40 lines
1.0 KiB
PHP
Raw Normal View History

<?php
/**
* PHPWord
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2010-2014 PHPWord contributors
2014-05-04 21:03:28 +04:00
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
*/
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);
}
}