Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sebastianbergmann/phpunit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.8.31
Choose a base ref
...
head repository: sebastianbergmann/phpunit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.8.32
Choose a head ref
  • 14 commits
  • 15 files changed
  • 2 contributors

Commits on Dec 13, 2016

  1. Closes #2396

    sebastianbergmann committed Dec 13, 2016

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    8ddd0dd View commit details

Commits on Dec 27, 2016

  1. Perform version check before including sourcecode files (because they…

    … could be incompatible with the version of PHP being used)
    sebastianbergmann committed Dec 27, 2016
    Copy the full SHA
    53e0082 View commit details

Commits on Dec 28, 2016

  1. Copy the full SHA
    ab62213 View commit details

Commits on Dec 29, 2016

  1. Copy the full SHA
    434f53b View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    ruyadorno Ruy Adorno
    Copy the full SHA
    9d2b62b View commit details

Commits on Dec 30, 2016

  1. Simplify

    sebastianbergmann committed Dec 30, 2016

    Verified

    This commit was signed with the committer’s verified signature.
    ruyadorno Ruy Adorno
    Copy the full SHA
    b3cda42 View commit details

Commits on Dec 31, 2016

  1. Verified

    This commit was signed with the committer’s verified signature.
    ruyadorno Ruy Adorno
    Copy the full SHA
    4324a44 View commit details

Commits on Jan 18, 2017

  1. Bump copyright year

    sebastianbergmann committed Jan 18, 2017
    Copy the full SHA
    43a6ae5 View commit details

Commits on Jan 19, 2017

  1. Copy the full SHA
    9d99dce View commit details
  2. Copy the full SHA
    834840e View commit details
  3. Update ChangeLog

    sebastianbergmann committed Jan 19, 2017
    Copy the full SHA
    fb75be0 View commit details

Commits on Jan 21, 2017

  1. Copy the full SHA
    e60ba3b View commit details
  2. Copy the full SHA
    1202e3c View commit details

Commits on Jan 22, 2017

  1. Prepare release

    sebastianbergmann committed Jan 22, 2017
    Copy the full SHA
    f5e1941 View commit details
Showing with 74 additions and 74 deletions.
  1. +2 −4 CONTRIBUTING.md
  2. +7 −0 ChangeLog-4.8.md
  3. +1 −1 LICENSE
  4. +5 −9 build.xml
  5. +10 −8 build/binary-phar-autoload.php.in
  6. +0 −39 build/phpunit.xml
  7. BIN build/tools/composer
  8. +13 −0 build/version.php
  9. +4 −4 phpunit
  10. +3 −1 src/Runner/Version.php
  11. +1 −1 src/TextUI/Command.php
  12. +8 −5 src/Util/XML.php
  13. +1 −1 tests/TextUI/help.phpt
  14. +1 −1 tests/TextUI/help2.phpt
  15. +18 −0 tests/Util/XMLTest.php
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -39,12 +39,10 @@ $ git clone git://github.com/sebastianbergmann/phpunit.git
$ cd phpunit
```

Retrieve PHPUnit's dependencies using [Composer](http://getcomposer.org/):
Retrieve PHPUnit's dependencies using [Composer](https://getcomposer.org/):

```bash
$ wget http://getcomposer.org/composer.phar

$ php composer.phar install
$ composer install
```

The `phpunit` script can be used to invoke the PHPUnit test runner:
7 changes: 7 additions & 0 deletions ChangeLog-4.8.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

All notable changes of the PHPUnit 4.8 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [4.8.32] - 2017-01-22

### Fixed

* Fixed [#2428](https://github.com/sebastianbergmann/phpunit/pull/2428): Nested arrays specificied in XML configuration file are not handled correctly

## [4.8.31] - 2016-12-09

### Fixed
@@ -221,6 +227,7 @@ New PHAR release due to updated dependencies
* Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808)
* Changed the name of the default group from `__nogroup__` to `default`

[4.8.32]: https://github.com/sebastianbergmann/phpunit/compare/4.8.31...4.8.32
[4.8.31]: https://github.com/sebastianbergmann/phpunit/compare/4.8.30...4.8.31
[4.8.30]: https://github.com/sebastianbergmann/phpunit/compare/4.8.29...4.8.30
[4.8.29]: https://github.com/sebastianbergmann/phpunit/compare/4.8.28...4.8.29
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PHPUnit

Copyright (c) 2001-2016, Sebastian Bergmann <sebastian@phpunit.de>.
Copyright (c) 2001-2017, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.

Redistribution and use in source and binary forms, with or without
14 changes: 5 additions & 9 deletions build.xml
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@

<target name="validate-composer-json" unless="validate-composer-json.done" description="Validate composer.json">
<exec executable="${basedir}/build/tools/composer" failonerror="true" taskname="composer">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
<arg value="validate"/>
<arg value="--no-check-lock"/>
<arg value="--strict"/>
@@ -44,7 +43,6 @@

<target name="install-dependencies" unless="dependencies-installed" depends="-dependencies-installed,validate-composer-json" description="Install dependencies with Composer">
<exec executable="${basedir}/build/tools/composer" taskname="composer">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
@@ -121,7 +119,6 @@
<copy file="${basedir}/composer.json" tofile="${basedir}/composer.json.bak"/>

<exec executable="${basedir}/build/tools/composer">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
<arg value="require"/>
<arg value="phpunit/dbunit:~1.4"/>
<arg value="phpunit/phpunit-selenium:~1.4"/>
@@ -333,10 +330,7 @@
</target>

<target name="-phar-determine-version">
<exec executable="bash" outputproperty="version">
<arg value="-c"/>
<arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'"/>
</exec>
<exec executable="${basedir}/build/version.php" outputproperty="version" />
</target>

<target name="generate-project-documentation" depends="-phploc,-phpcs,-phpmd,-phpunit">
@@ -375,8 +369,10 @@

<target name="-phpunit" depends="setup">
<exec executable="${basedir}/phpunit" taskname="phpunit">
<arg value="--configuration"/>
<arg path="${basedir}/build/phpunit.xml"/>
<arg value="--coverage-xml"/>
<arg path="${basedir}/build/logfiles/coverage"/>
<arg value="--log-junit"/>
<arg path="${basedir}/build/logfiles/junit.xml"/>
</exec>
</target>
</project>
18 changes: 10 additions & 8 deletions build/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
@@ -6,15 +6,8 @@ if (__FILE__ == realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
$execute = false;
}

define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');

Phar::mapPhar('___PHAR___');

___FILELIST___

if ($execute) {
if (version_compare('5.3.3', PHP_VERSION, '>') && $argv[1] !== '--version') {
if (version_compare('5.3.3', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
@@ -27,7 +20,16 @@ if ($execute) {

die(1);
}
}

define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');

Phar::mapPhar('___PHAR___');

___FILELIST___

if ($execute) {
if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
exit;
39 changes: 0 additions & 39 deletions build/phpunit.xml

This file was deleted.

Binary file modified build/tools/composer
Binary file not shown.
13 changes: 13 additions & 0 deletions build/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php
require __DIR__ . '/../vendor/autoload.php';

use SebastianBergmann\Version;

$buffer = file_get_contents(__DIR__ . '/../src/Runner/Version.php');
$start = strpos($buffer, 'new Version(\'') + strlen('new Version(\'');
$end = strpos($buffer, '\'', $start);
$version = substr($buffer, $start, $end - $start);
$version = new Version($version, __DIR__ . '/../');

print $version->getVersion();
8 changes: 4 additions & 4 deletions phpunit
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

if (version_compare('5.3.3', PHP_VERSION, '>') && $argv[1] !== '--version') {
if (version_compare('5.3.3', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
@@ -39,9 +39,9 @@ unset($file);

if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
fwrite(STDERR,
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
'php composer.phar install' . PHP_EOL
'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
' composer install' . PHP_EOL . PHP_EOL .
'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
);

die(1);
4 changes: 3 additions & 1 deletion src/Runner/Version.php
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@
* file that was distributed with this source code.
*/

use SebastianBergmann\Version;

/**
* This class defines the current version of PHPUnit.
*
@@ -30,7 +32,7 @@ public static function id()
}

if (self::$version === null) {
$version = new SebastianBergmann\Version('4.8.31', dirname(dirname(__DIR__)));
$version = new Version('4.8.32', dirname(dirname(__DIR__)));
self::$version = $version->getVersion();
}

2 changes: 1 addition & 1 deletion src/TextUI/Command.php
Original file line number Diff line number Diff line change
@@ -924,7 +924,7 @@ protected function showHelp()
Test Selection Options:
--filter <pattern> Filter which tests to run.
--testsuite <pattern> Filter which testsuite to run.
--testsuite <name> Filter which testsuite to run.
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
--list-groups List available test groups.
13 changes: 8 additions & 5 deletions src/Util/XML.php
Original file line number Diff line number Diff line change
@@ -222,17 +222,20 @@ public static function xmlToVariable(DOMElement $element)
case 'array':
$variable = array();

foreach ($element->getElementsByTagName('element') as $element) {
$item = $element->childNodes->item(0);
foreach ($element->childNodes as $entry) {
if (!$entry instanceof DOMElement || $entry->tagName !== 'element') {
continue;
}
$item = $entry->childNodes->item(0);

if ($item instanceof DOMText) {
$item = $element->childNodes->item(1);
$item = $entry->childNodes->item(1);
}

$value = self::xmlToVariable($item);

if ($element->hasAttribute('key')) {
$variable[(string) $element->getAttribute('key')] = $value;
if ($entry->hasAttribute('key')) {
$variable[(string) $entry->getAttribute('key')] = $value;
} else {
$variable[] = $value;
}
2 changes: 1 addition & 1 deletion tests/TextUI/help.phpt
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ Logging Options:
Test Selection Options:

--filter <pattern> Filter which tests to run.
--testsuite <pattern> Filter which testsuite to run.
--testsuite <name> Filter which testsuite to run.
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
--list-groups List available test groups.
2 changes: 1 addition & 1 deletion tests/TextUI/help2.phpt
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ Logging Options:
Test Selection Options:

--filter <pattern> Filter which tests to run.
--testsuite <pattern> Filter which testsuite to run.
--testsuite <name> Filter which testsuite to run.
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
--list-groups List available test groups.
18 changes: 18 additions & 0 deletions tests/Util/XMLTest.php
Original file line number Diff line number Diff line change
@@ -342,4 +342,22 @@ public function testLoadBoolean()
{
PHPUnit_Util_XML::load(false);
}

public function testNestedXmlToVariable()
{
$xml = '<array><element key="a"><array><element key="b"><string>foo</string></element></array></element><element key="c"><string>bar</string></element></array>';
$dom = new DOMDocument();
$dom->loadXML($xml);

$expected = array(
'a' => array(
'b' => 'foo',
),
'c' => 'bar',
);

$actual = PHPUnit_Util_XML::xmlToVariable($dom->documentElement);

$this->assertSame($expected, $actual);
}
}