diff --git a/.travis.yml b/.travis.yml index 127a3b5fa3..8e22e1323f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,8 @@ services: - redis-server before_install: + - mkdir /tmp/slapd + - slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 & # Matrix lines for intermediate PHP versions are skipped for pull requests - if [[ ! $deps && ! $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; fi; # A sigchild-enabled-PHP is used to test the Process component on the lowest PHP matrix line @@ -57,9 +59,6 @@ before_install: - if [[ $deps != skip && $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer/* ~/.composer/; composer global install; fi; - if [[ $deps != skip ]]; then ./phpunit install; fi; - export PHPUNIT=$(readlink -f ./phpunit) - - mkdir /tmp/slapd - - slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 & - - sleep 3 - ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/base.ldif - ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index efd1710292..390c4909dc 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -19,6 +19,7 @@ namespace Symfony\Bridge\PhpUnit; class DeprecationErrorHandler { const MODE_WEAK = 'weak'; + const MODE_DISABLED = 'disabled'; private static $isRegistered = false; @@ -67,11 +68,10 @@ class DeprecationErrorHandler 'other' => array(), ); $deprecationHandler = function ($type, $msg, $file, $line, $context) use (&$deprecations, $getMode) { - if (E_USER_DEPRECATED !== $type) { + if (E_USER_DEPRECATED !== $type || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) { return \PHPUnit_Util_ErrorHandler::handleError($type, $msg, $file, $line, $context); } - $mode = $getMode(); $trace = debug_backtrace(true); $group = 'other'; diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt new file mode 100644 index 0000000000..0115bbd242 --- /dev/null +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test DeprecationErrorHandler in weak mode +--FILE-- + +--EXPECTF-- +00 diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php b/src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php index 8da1283324..034d07a30f 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php +++ b/src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php @@ -13,8 +13,6 @@ namespace Symfony\Bridge\PhpUnit\Tests; use Symfony\Bridge\PhpUnit\DnsMock; -require_once __DIR__.'/../DnsMock.php'; - class DnsMockTest extends \PHPUnit_Framework_TestCase { protected function tearDown() diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php index 1283da08fa..5e2ed0ca85 100644 --- a/src/Symfony/Bridge/PhpUnit/bootstrap.php +++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php @@ -24,4 +24,6 @@ if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && cl AnnotationRegistry::registerLoader('class_exists'); } -DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER')); +if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) { + DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER')); +}