Merge branch '4.4'
* 4.4: [PhpUnitBridge] Fix tests
This commit is contained in:
commit
d5b01afd13
@ -26,6 +26,12 @@ class DeprecationTest extends TestCase
|
|||||||
|
|
||||||
public function testItCanTellWhetherItIsInternal()
|
public function testItCanTellWhetherItIsInternal()
|
||||||
{
|
{
|
||||||
|
$r = new \ReflectionClass(Deprecation::class);
|
||||||
|
|
||||||
|
if (dirname($r->getFileName(), 2) !== dirname(__DIR__, 2)) {
|
||||||
|
$this->markTestSkipped('Test case is not compatible with having the bridge in vendor/');
|
||||||
|
}
|
||||||
|
|
||||||
$deprecation = new Deprecation('💩', $this->debugBacktrace(), __FILE__);
|
$deprecation = new Deprecation('💩', $this->debugBacktrace(), __FILE__);
|
||||||
$this->assertSame(Deprecation::TYPE_SELF, $deprecation->getType());
|
$this->assertSame(Deprecation::TYPE_SELF, $deprecation->getType());
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
Test DeprecationErrorHandler in disabled mode
|
Test DeprecationErrorHandler in weak mode
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$_SERVER['SYMFONY_DEPRECATIONS_HELPER'] = 'disabled';
|
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
|
||||||
putenv('ANSICON');
|
putenv('ANSICON');
|
||||||
putenv('ConEmuANSI');
|
putenv('ConEmuANSI');
|
||||||
putenv('TERM');
|
putenv('TERM');
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
--TEST--
|
|
||||||
Test DeprecationErrorHandler in disabled mode (via putenv)
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$_ENV['SYMFONY_DEPRECATIONS_HELPER'] = 'disabled';
|
|
||||||
putenv('ANSICON');
|
|
||||||
putenv('ConEmuANSI');
|
|
||||||
putenv('TERM');
|
|
||||||
|
|
||||||
$vendor = __DIR__;
|
|
||||||
while (!file_exists($vendor.'/vendor')) {
|
|
||||||
$vendor = dirname($vendor);
|
|
||||||
}
|
|
||||||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
|
|
||||||
require PHPUNIT_COMPOSER_INSTALL;
|
|
||||||
require_once __DIR__.'/../../bootstrap.php';
|
|
||||||
|
|
||||||
echo (int) set_error_handler('var_dump');
|
|
||||||
echo (int) class_exists('Symfony\Bridge\PhpUnit\DeprecationErrorHandler', false);
|
|
||||||
|
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
00
|
|
@ -1,24 +0,0 @@
|
|||||||
--TEST--
|
|
||||||
Test DeprecationErrorHandler in disabled mode (via putenv)
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
|
|
||||||
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
|
|
||||||
putenv('ANSICON');
|
|
||||||
putenv('ConEmuANSI');
|
|
||||||
putenv('TERM');
|
|
||||||
|
|
||||||
$vendor = __DIR__;
|
|
||||||
while (!file_exists($vendor.'/vendor')) {
|
|
||||||
$vendor = dirname($vendor);
|
|
||||||
}
|
|
||||||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
|
|
||||||
require PHPUNIT_COMPOSER_INSTALL;
|
|
||||||
require_once __DIR__.'/../../bootstrap.php';
|
|
||||||
|
|
||||||
echo (int) set_error_handler('var_dump');
|
|
||||||
echo (int) class_exists('Symfony\Bridge\PhpUnit\DeprecationErrorHandler', false);
|
|
||||||
|
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
00
|
|
Reference in New Issue
Block a user