You are here

public function DebugClassLoaderTest::testReservedForPhp7 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/Tests/DebugClassLoaderTest.php \Symfony\Component\Debug\Tests\DebugClassLoaderTest::testReservedForPhp7()

File

vendor/symfony/debug/Tests/DebugClassLoaderTest.php, line 228

Class

DebugClassLoaderTest

Namespace

Symfony\Component\Debug\Tests

Code

public function testReservedForPhp7() {
  if (PHP_VERSION_ID >= 70000) {
    $this
      ->markTestSkipped('PHP7 already prevents using reserved names.');
  }
  set_error_handler('var_dump', 0);
  $e = error_reporting(0);
  trigger_error('', E_USER_NOTICE);
  class_exists('Test\\' . __NAMESPACE__ . '\\Float', true);
  error_reporting($e);
  restore_error_handler();
  $lastError = error_get_last();
  unset($lastError['file'], $lastError['line']);
  $xError = array(
    'type' => E_USER_DEPRECATED,
    'message' => 'Test\\Symfony\\Component\\Debug\\Tests\\Float uses a reserved class name (Float) that will break on PHP 7 and higher',
  );
  $this
    ->assertSame($xError, $lastError);
}