You are here

public function InvalidArgumentExceptionTest::testFromNonExistingTypeWithTrait in Zircon Profile 8

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

File

vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php, line 44

Class

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

Namespace

DoctrineTest\InstantiatorTest\Exception

Code

public function testFromNonExistingTypeWithTrait() {
  if (PHP_VERSION_ID < 50400) {
    $this
      ->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run');
  }
  $exception = InvalidArgumentException::fromNonExistingClass('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset');
  $this
    ->assertSame('The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, ' . 'and can not be instantiated', $exception
    ->getMessage());
}