You are here

public function FlattenExceptionTest::testSetTraceIncompleteClass in Zircon Profile 8

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

File

vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php, line 216

Class

FlattenExceptionTest

Namespace

Symfony\Component\Debug\Tests\Exception

Code

public function testSetTraceIncompleteClass() {
  $flattened = FlattenException::create(new \Exception('test', 123));
  $flattened
    ->setTrace(array(
    array(
      'file' => __FILE__,
      'line' => 123,
      'function' => 'test',
      'args' => array(
        unserialize('O:14:"BogusTestClass":0:{}'),
      ),
    ),
  ), 'foo.php', 123);
  $this
    ->assertEquals(array(
    array(
      'message' => 'test',
      'class' => 'Exception',
      'trace' => array(
        array(
          'namespace' => '',
          'short_class' => '',
          'class' => '',
          'type' => '',
          'function' => '',
          'file' => 'foo.php',
          'line' => 123,
          'args' => array(),
        ),
        array(
          'namespace' => '',
          'short_class' => '',
          'class' => '',
          'type' => '',
          'function' => 'test',
          'file' => __FILE__,
          'line' => 123,
          'args' => array(
            array(
              'incomplete-object',
              'BogusTestClass',
            ),
          ),
        ),
      ),
    ),
  ), $flattened
    ->toArray());
}