You are here

public function UndefinedFunctionFatalErrorHandlerTest::testUndefinedFunction in Zircon Profile 8.0

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

@dataProvider provideUndefinedFunctionData

File

vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php, line 22

Class

UndefinedFunctionFatalErrorHandlerTest

Namespace

Symfony\Component\Debug\Tests\FatalErrorHandler

Code

public function testUndefinedFunction($error, $translatedMessage) {
  $handler = new UndefinedFunctionFatalErrorHandler();
  $exception = $handler
    ->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
  $this
    ->assertInstanceOf('Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException', $exception);

  // class names are case insensitive and PHP/HHVM do not return the same
  $this
    ->assertSame(strtolower($translatedMessage), strtolower($exception
    ->getMessage()));
  $this
    ->assertSame($error['type'], $exception
    ->getSeverity());
  $this
    ->assertSame($error['file'], $exception
    ->getFile());
  $this
    ->assertSame($error['line'], $exception
    ->getLine());
}