Skip to content

Commit

Permalink
Merge pull request #24 from troosan/update_phpunit
Browse files Browse the repository at this point in the history
update phpunit version
  • Loading branch information
Progi1984 authored Jul 13, 2018
2 parents 522e3fd + 1cba09c commit 10c5c81
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"pclzip/pclzip": "^2.8"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/phpunit": "^4.8.36 || ^7.0",
"phpdocumentor/phpdocumentor":"2.*",
"phpmd/phpmd": "2.*",
"sebastian/phpcpd": "2.*",
Expand Down
5 changes: 2 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
stopOnFailure="false">
<testsuites>
<testsuite name="PhpOffice Common Test Suite">
<directory>./tests/Common</directory>
Expand All @@ -19,7 +18,7 @@
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./build/coverage" charset="UTF-8" highlight="true" />
<log type="coverage-html" target="./build/coverage" />
<log type="coverage-clover" target="./build/logs/clover.xml" />
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpOffice\Common\Tests\TestHelperZip;

abstract class AbstractZipAdapterTest extends \PHPUnit_Framework_TestCase
abstract class AbstractZipAdapterTest extends \PHPUnit\Framework\TestCase
{
protected $zipTest;

Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/AutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Test class for Autoloader
*/
class AutoloaderTest extends \PHPUnit_Framework_TestCase
class AutoloaderTest extends \PHPUnit\Framework\TestCase
{
/**
* Register
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/DrawingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\IOFactory
*/
class DrawingTest extends \PHPUnit_Framework_TestCase
class DrawingTest extends \PHPUnit\Framework\TestCase
{
/**
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\File
*/
class FileTest extends \PHPUnit_Framework_TestCase
class FileTest extends \PHPUnit\Framework\TestCase
{
/**
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/FontTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\Font
*/
class FontTest extends \PHPUnit_Framework_TestCase
class FontTest extends \PHPUnit\Framework\TestCase
{
/**
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/Microsoft/PasswordEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Test class for PhpOffice\Common\PasswordEncoder
* @coversDefaultClass \PhpOffice\Common\PasswordEncoder
*/
class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
class PasswordEncoderTest extends \PHPUnit\Framework\TestCase
{
/**
* Test that a password can be hashed without specifying any additional parameters
Expand Down
8 changes: 4 additions & 4 deletions tests/Common/Tests/TextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\Text
*/
class TextTest extends \PHPUnit_Framework_TestCase
class TextTest extends \PHPUnit\Framework\TestCase
{
/**
*/
Expand All @@ -39,14 +39,14 @@ public function testControlCharacters()
$this->assertEquals('', Text::controlCharacterOOXML2PHP(''));
$this->assertEquals(chr(0x08), Text::controlCharacterOOXML2PHP('_x0008_'));
}

public function testNumberFormat()
{
$this->assertEquals('2.1', Text::numberFormat('2.06', 1));
$this->assertEquals('2.1', Text::numberFormat('2.12', 1));
$this->assertEquals('1234', Text::numberFormat(1234, 1));
$this->assertEquals('1234.0', Text::numberFormat(1234, 1));
}

public function testChr()
{
$this->assertEquals('A', Text::chr(65));
Expand Down
19 changes: 11 additions & 8 deletions tests/Common/Tests/XMLReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\XMLReader
*/
class XMLReaderTest extends \PHPUnit_Framework_TestCase
class XMLReaderTest extends \PHPUnit\Framework\TestCase
{
/**
* Test reading XML from string
Expand Down Expand Up @@ -94,16 +94,19 @@ public function testReturnNullOnNonExistingNode()

/**
* Test that xpath fails if custom namespace is not registered
*
* @expectedException Exception
*/
public function testShouldThrowExceptionIfNamespaceIsNotKnown()
{
$reader = new XMLReader();
$reader->getDomFromString('<element><test:child xmlns:test="http://phpword.com/my/custom/namespace">AAA</test:child></element>');

$this->assertTrue($reader->elementExists('/element/test:child'));
$this->assertEquals('AAA', $reader->getElement('/element/test:child')->textContent);
try {
$reader = new XMLReader();
$reader->getDomFromString('<element><test:child xmlns:test="http://phpword.com/my/custom/namespace">AAA</test:child></element>');

$this->assertTrue($reader->elementExists('/element/test:child'));
$this->assertEquals('AAA', $reader->getElement('/element/test:child')->textContent);
$this->fail();
} catch (\Exception $e) {
$this->assertTrue(true);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/XMLWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @coversDefaultClass PhpOffice\Common\XMLWriter
*/
class XMLWriterTest extends \PHPUnit_Framework_TestCase
class XMLWriterTest extends \PHPUnit\Framework\TestCase
{
/**
*/
Expand Down

0 comments on commit 10c5c81

Please sign in to comment.