Skip to content

Commit 10c5c81

Browse files
authored
Merge pull request #24 from troosan/update_phpunit
update phpunit version
2 parents 522e3fd + 1cba09c commit 10c5c81

File tree

11 files changed

+25
-23
lines changed

11 files changed

+25
-23
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"pclzip/pclzip": "^2.8"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "3.7.*",
22+
"phpunit/phpunit": "^4.8.36 || ^7.0",
2323
"phpdocumentor/phpdocumentor":"2.*",
2424
"phpmd/phpmd": "2.*",
2525
"sebastian/phpcpd": "2.*",

phpunit.xml.dist

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
convertNoticesToExceptions="true"
77
convertWarningsToExceptions="true"
88
processIsolation="false"
9-
stopOnFailure="false"
10-
syntaxCheck="false">
9+
stopOnFailure="false">
1110
<testsuites>
1211
<testsuite name="PhpOffice Common Test Suite">
1312
<directory>./tests/Common</directory>
@@ -19,7 +18,7 @@
1918
</whitelist>
2019
</filter>
2120
<logging>
22-
<log type="coverage-html" target="./build/coverage" charset="UTF-8" highlight="true" />
21+
<log type="coverage-html" target="./build/coverage" />
2322
<log type="coverage-clover" target="./build/logs/clover.xml" />
2423
</logging>
2524
</phpunit>

tests/Common/Tests/Adapter/Zip/AbstractZipAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PhpOffice\Common\Tests\TestHelperZip;
66

7-
abstract class AbstractZipAdapterTest extends \PHPUnit_Framework_TestCase
7+
abstract class AbstractZipAdapterTest extends \PHPUnit\Framework\TestCase
88
{
99
protected $zipTest;
1010

tests/Common/Tests/AutoloaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Test class for Autoloader
2323
*/
24-
class AutoloaderTest extends \PHPUnit_Framework_TestCase
24+
class AutoloaderTest extends \PHPUnit\Framework\TestCase
2525
{
2626
/**
2727
* Register

tests/Common/Tests/DrawingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @coversDefaultClass PhpOffice\Common\IOFactory
2525
*/
26-
class DrawingTest extends \PHPUnit_Framework_TestCase
26+
class DrawingTest extends \PHPUnit\Framework\TestCase
2727
{
2828
/**
2929
*/

tests/Common/Tests/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @coversDefaultClass PhpOffice\Common\File
2525
*/
26-
class FileTest extends \PHPUnit_Framework_TestCase
26+
class FileTest extends \PHPUnit\Framework\TestCase
2727
{
2828
/**
2929
*/

tests/Common/Tests/FontTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @coversDefaultClass PhpOffice\Common\Font
2525
*/
26-
class FontTest extends \PHPUnit_Framework_TestCase
26+
class FontTest extends \PHPUnit\Framework\TestCase
2727
{
2828
/**
2929
*/

tests/Common/Tests/Microsoft/PasswordEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Test class for PhpOffice\Common\PasswordEncoder
2323
* @coversDefaultClass \PhpOffice\Common\PasswordEncoder
2424
*/
25-
class PasswordEncoderTest extends \PHPUnit_Framework_TestCase
25+
class PasswordEncoderTest extends \PHPUnit\Framework\TestCase
2626
{
2727
/**
2828
* Test that a password can be hashed without specifying any additional parameters

tests/Common/Tests/TextTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @coversDefaultClass PhpOffice\Common\Text
2525
*/
26-
class TextTest extends \PHPUnit_Framework_TestCase
26+
class TextTest extends \PHPUnit\Framework\TestCase
2727
{
2828
/**
2929
*/
@@ -39,14 +39,14 @@ public function testControlCharacters()
3939
$this->assertEquals('', Text::controlCharacterOOXML2PHP(''));
4040
$this->assertEquals(chr(0x08), Text::controlCharacterOOXML2PHP('_x0008_'));
4141
}
42-
42+
4343
public function testNumberFormat()
4444
{
4545
$this->assertEquals('2.1', Text::numberFormat('2.06', 1));
4646
$this->assertEquals('2.1', Text::numberFormat('2.12', 1));
47-
$this->assertEquals('1234', Text::numberFormat(1234, 1));
47+
$this->assertEquals('1234.0', Text::numberFormat(1234, 1));
4848
}
49-
49+
5050
public function testChr()
5151
{
5252
$this->assertEquals('A', Text::chr(65));

tests/Common/Tests/XMLReaderTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @coversDefaultClass PhpOffice\Common\XMLReader
2525
*/
26-
class XMLReaderTest extends \PHPUnit_Framework_TestCase
26+
class XMLReaderTest extends \PHPUnit\Framework\TestCase
2727
{
2828
/**
2929
* Test reading XML from string
@@ -94,16 +94,19 @@ public function testReturnNullOnNonExistingNode()
9494

9595
/**
9696
* Test that xpath fails if custom namespace is not registered
97-
*
98-
* @expectedException Exception
9997
*/
10098
public function testShouldThrowExceptionIfNamespaceIsNotKnown()
10199
{
102-
$reader = new XMLReader();
103-
$reader->getDomFromString('<element><test:child xmlns:test="http://phpword.com/my/custom/namespace">AAA</test:child></element>');
104-
105-
$this->assertTrue($reader->elementExists('/element/test:child'));
106-
$this->assertEquals('AAA', $reader->getElement('/element/test:child')->textContent);
100+
try {
101+
$reader = new XMLReader();
102+
$reader->getDomFromString('<element><test:child xmlns:test="http://phpword.com/my/custom/namespace">AAA</test:child></element>');
103+
104+
$this->assertTrue($reader->elementExists('/element/test:child'));
105+
$this->assertEquals('AAA', $reader->getElement('/element/test:child')->textContent);
106+
$this->fail();
107+
} catch (\Exception $e) {
108+
$this->assertTrue(true);
109+
}
107110
}
108111

109112
/**

0 commit comments

Comments
 (0)