You are here

public function ClassNotFoundFatalErrorHandlerTest::testCannotRedeclareClass in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php \Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testCannotRedeclareClass()

File

vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php, line 180

Class

ClassNotFoundFatalErrorHandlerTest

Namespace

Symfony\Component\Debug\Tests\FatalErrorHandler

Code

public function testCannotRedeclareClass() {
  if (!file_exists(__DIR__ . '/../FIXTURES2/REQUIREDTWICE.PHP')) {
    $this
      ->markTestSkipped('Can only be run on case insensitive filesystems');
  }
  require_once __DIR__ . '/../FIXTURES2/REQUIREDTWICE.PHP';
  $error = array(
    'type' => 1,
    'line' => 12,
    'file' => 'foo.php',
    'message' => 'Class \'Foo\\Bar\\RequiredTwice\' not found',
  );
  $handler = new ClassNotFoundFatalErrorHandler();
  $exception = $handler
    ->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
  $this
    ->assertInstanceOf('Symfony\\Component\\Debug\\Exception\\ClassNotFoundException', $exception);
}