You are here

public function UnexpectedValueExceptionTest::testFromUncleanUnSerialization in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php \DoctrineTest\InstantiatorTest\Exception\UnexpectedValueExceptionTest::testFromUncleanUnSerialization()

File

vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php, line 51

Class

UnexpectedValueExceptionTest
Tests for { @author Marco Pivetta <ocramius@gmail.com>

Namespace

DoctrineTest\InstantiatorTest\Exception

Code

public function testFromUncleanUnSerialization() {
  $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
  $exception = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456);
  $this
    ->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
  $this
    ->assertSame('Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" ' . 'via un-serialization, since an error was triggered in file "bar" at line "456"', $exception
    ->getMessage());
  $previous = $exception
    ->getPrevious();
  $this
    ->assertInstanceOf('Exception', $previous);
  $this
    ->assertSame('foo', $previous
    ->getMessage());
  $this
    ->assertSame(123, $previous
    ->getCode());
}