Skip to content

[PhpUnit] Auto-register SymfonyTestsListener #16197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
passthru("$COMPOSER remove --no-update symfony/yaml");
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
passthru("$COMPOSER install --prefer-source --no-progress --ansi");
file_put_contents('phpunit', <<<EOPHP
<?php

define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
Symfony\Bridge\PhpUnit\TextUI\Command::main();

EOPHP
);
chdir('..');
if (file_exists('../src/Symfony/Bridge/PhpUnit') && `git diff --name-only HEAD^ -- ../src/Symfony/Bridge/PhpUnit`) {
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'del /S /F /Q %s & rmdir %1$s >nul 2>&1': 'rm -rf %s', str_replace('/', DIRECTORY_SEPARATOR, "phpunit-$PHPUNIT_VERSION/vendor/symfony/phpunit-bridge")));
Expand Down
4 changes: 0 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bridge/Doctrine/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bridge/Monolog/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class SkippedTestsListener extends \PHPUnit_Framework_BaseTestListener
class SymfonyTestsListener extends \PHPUnit_Framework_BaseTestListener
{
private $state = -1;
private $skippedFile = false;
Expand Down
26 changes: 26 additions & 0 deletions src/Symfony/Bridge/PhpUnit/TextUI/Command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\PhpUnit\TextUI;

/**
* {@inheritdoc}
*/
class Command extends \PHPUnit_TextUI_Command
{
/**
* {@inheritdoc}
*/
protected function createRunner()
{
return new TestRunner($this->arguments['loader']);
}
}
31 changes: 31 additions & 0 deletions src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\PhpUnit\TextUI;

use Symfony\Bridge\PhpUnit\SymfonyTestsListener;

/**
* {@inheritdoc}
*/
class TestRunner extends \PHPUnit_TextUI_TestRunner
{
/**
* {@inheritdoc}
*/
protected function handleConfiguration(array &$arguments)
{
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
$arguments['listeners'][] = new SymfonyTestsListener();

return parent::handleConfiguration($arguments);
}
}
4 changes: 0 additions & 4 deletions src/Symfony/Bridge/ProxyManager/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bridge/Twig/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/DebugBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/SecurityBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/TwigBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Bundle/WebProfilerBundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Asset/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/BrowserKit/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/ClassLoader/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Config/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Console/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/CssSelector/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Debug/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/DependencyInjection/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/DomCrawler/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/EventDispatcher/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/ExpressionLanguage/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Filesystem/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Finder/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Form/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/HttpFoundation/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/HttpKernel/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Intl/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Ldap/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Locale/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/OptionsResolver/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Process/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/PropertyAccess/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/PropertyInfo/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Routing/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
4 changes: 0 additions & 4 deletions src/Symfony/Component/Security/Core/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>
Loading