summaryrefslogtreecommitdiff
path: root/vendor/symfony/debug/Tests
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-10-10 09:16:43 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-10-10 09:28:26 +0100
commit60362583a738c1540f918e048f7719906ff0ffd8 (patch)
tree52ca2d2fa947217a745e79e10a82315a669ac8eb /vendor/symfony/debug/Tests
parent15d8c1a555b43adf8338a30f36846f1640f50c00 (diff)
downloadwebtrees-60362583a738c1540f918e048f7719906ff0ffd8.tar.gz
webtrees-60362583a738c1540f918e048f7719906ff0ffd8.tar.bz2
webtrees-60362583a738c1540f918e048f7719906ff0ffd8.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/debug/Tests')
-rw-r--r--vendor/symfony/debug/Tests/DebugClassLoaderTest.php35
-rw-r--r--vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php8
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php2
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/FinalMethod.php7
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/FinalMethod2Trait.php10
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/TraitWithInternalMethod.php13
-rw-r--r--vendor/symfony/debug/Tests/phpt/debug_class_loader.phpt1
-rw-r--r--vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt3
8 files changed, 63 insertions, 16 deletions
diff --git a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
index 0219f53350..e9ce535ee7 100644
--- a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
+++ b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
@@ -312,24 +312,21 @@ class DebugClassLoaderTest extends TestCase
public function testExtendedFinalMethod()
{
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
+ $deprecations = array();
+ set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
+ $e = error_reporting(E_USER_DEPRECATED);
class_exists(__NAMESPACE__.'\\Fixtures\\ExtendedFinalMethod', true);
error_reporting($e);
restore_error_handler();
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
$xError = array(
- 'type' => E_USER_DEPRECATED,
- 'message' => 'The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod()" method is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod()" method is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod2()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".',
);
- $this->assertSame($xError, $lastError);
+ $this->assertSame($xError, $deprecations);
}
public function testExtendedDeprecatedMethodDoesntTriggerAnyNotice()
@@ -361,12 +358,26 @@ class DebugClassLoaderTest extends TestCase
restore_error_handler();
$this->assertSame($deprecations, array(
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalClass" class is considered internal since version 3.4. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternalsParent".',
'The "Symfony\Component\Debug\Tests\Fixtures\InternalInterface" interface is considered internal. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternalsParent".',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\InternalClass" class is considered internal since version 3.4. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternalsParent".',
'The "Symfony\Component\Debug\Tests\Fixtures\InternalTrait" trait is considered internal. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternals".',
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalTrait2::internalMethod()" method is considered internal since version 3.4. It may change without further notice. You should not extend it from "Test\Symfony\Component\Debug\Tests\ExtendsInternals".',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\InternalClass::internalMethod()" method is considered internal since version 3.4. It may change without further notice. You should not extend it from "Test\Symfony\Component\Debug\Tests\ExtendsInternals".',
));
}
+
+ public function testUseTraitWithInternalMethod()
+ {
+ $deprecations = array();
+ set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
+ $e = error_reporting(E_USER_DEPRECATED);
+
+ class_exists('Test\\'.__NAMESPACE__.'\\UseTraitWithInternalMethod', true);
+
+ error_reporting($e);
+ restore_error_handler();
+
+ $this->assertSame(array(), $deprecations);
+ }
}
class ClassLoader
@@ -420,6 +431,8 @@ class ClassLoader
}');
} elseif ('Test\\'.__NAMESPACE__.'\ExtendsInternalsParent' === $class) {
eval('namespace Test\\'.__NAMESPACE__.'; class ExtendsInternalsParent extends \\'.__NAMESPACE__.'\Fixtures\InternalClass implements \\'.__NAMESPACE__.'\Fixtures\InternalInterface { }');
+ } elseif ('Test\\'.__NAMESPACE__.'\UseTraitWithInternalMethod' === $class) {
+ eval('namespace Test\\'.__NAMESPACE__.'; class UseTraitWithInternalMethod { use \\'.__NAMESPACE__.'\Fixtures\TraitWithInternalMethod; }');
}
}
}
diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
index 739e5b2b15..a2647f57f2 100644
--- a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
+++ b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
@@ -64,10 +64,10 @@ class UndefinedMethodFatalErrorHandlerTest extends TestCase
),
array(
array(
- 'type' => 1,
- 'message' => 'Call to undefined method class@anonymous::test()',
- 'file' => '/home/possum/work/symfony/test.php',
- 'line' => 11,
+ 'type' => 1,
+ 'message' => 'Call to undefined method class@anonymous::test()',
+ 'file' => '/home/possum/work/symfony/test.php',
+ 'line' => 11,
),
'Attempted to call an undefined method named "test" of class "class@anonymous".',
),
diff --git a/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php b/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php
index 2bd337e5a2..050d19ff5e 100644
--- a/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php
+++ b/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php
@@ -4,6 +4,8 @@ namespace Symfony\Component\Debug\Tests\Fixtures;
class ExtendedFinalMethod extends FinalMethod
{
+ use FinalMethod2Trait;
+
/**
* {@inheritdoc}
*/
diff --git a/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php b/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
index 92ec421863..98a47524c4 100644
--- a/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
+++ b/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
@@ -11,6 +11,13 @@ class FinalMethod
{
}
+ /**
+ * @final
+ */
+ public function finalMethod2()
+ {
+ }
+
public function anotherMethod()
{
}
diff --git a/vendor/symfony/debug/Tests/Fixtures/FinalMethod2Trait.php b/vendor/symfony/debug/Tests/Fixtures/FinalMethod2Trait.php
new file mode 100644
index 0000000000..8547f3afed
--- /dev/null
+++ b/vendor/symfony/debug/Tests/Fixtures/FinalMethod2Trait.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Symfony\Component\Debug\Tests\Fixtures;
+
+trait FinalMethod2Trait
+{
+ public function finalMethod2()
+ {
+ }
+}
diff --git a/vendor/symfony/debug/Tests/Fixtures/TraitWithInternalMethod.php b/vendor/symfony/debug/Tests/Fixtures/TraitWithInternalMethod.php
new file mode 100644
index 0000000000..4c3dae37ab
--- /dev/null
+++ b/vendor/symfony/debug/Tests/Fixtures/TraitWithInternalMethod.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace Symfony\Component\Debug\Tests\Fixtures;
+
+trait TraitWithInternalMethod
+{
+ /**
+ * @internal
+ */
+ public function foo()
+ {
+ }
+}
diff --git a/vendor/symfony/debug/Tests/phpt/debug_class_loader.phpt b/vendor/symfony/debug/Tests/phpt/debug_class_loader.phpt
index b1e9c8390d..26b3abf4d7 100644
--- a/vendor/symfony/debug/Tests/phpt/debug_class_loader.phpt
+++ b/vendor/symfony/debug/Tests/phpt/debug_class_loader.phpt
@@ -24,3 +24,4 @@ class_exists(ExtendedFinalMethod::class);
?>
--EXPECTF--
The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod()" method is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".
+The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod2()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".
diff --git a/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt b/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt
index 7211afbdf8..9cd44388c3 100644
--- a/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt
+++ b/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt
@@ -1,5 +1,7 @@
--TEST--
Test catching fatal errors when handlers are nested
+--INI--
+display_errors=0
--FILE--
<?php
@@ -24,7 +26,6 @@ if (true) {
?>
--EXPECTF--
-Fatal error: Class 'Symfony\Component\Debug\missing' not found in %s on line %d
object(Symfony\Component\Debug\Exception\ClassNotFoundException)#%d (8) {
["message":protected]=>
string(131) "Attempted to load class "missing" from namespace "Symfony\Component\Debug".