You are here

class RuntimeReflectionServiceTest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php \Doctrine\Tests\Common\Persistence\Mapping\RuntimeReflectionServiceTest

@group DCOM-93

Hierarchy

  • class \Doctrine\Tests\Common\Persistence\Mapping\RuntimeReflectionServiceTest extends \Doctrine\Tests\Common\Persistence\Mapping\PHPUnit_Framework_TestCase

Expanded class hierarchy of RuntimeReflectionServiceTest

1 string reference to 'RuntimeReflectionServiceTest'
RuntimeReflectionServiceTest::testShortname in vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php, line 27

Namespace

Doctrine\Tests\Common\Persistence\Mapping
View source
class RuntimeReflectionServiceTest extends \PHPUnit_Framework_TestCase {

  /**
   * @var RuntimeReflectionService
   */
  private $reflectionService;
  public $unusedPublicProperty;
  public function setUp() {
    $this->reflectionService = new RuntimeReflectionService();
  }
  public function testShortname() {
    $this
      ->assertEquals("RuntimeReflectionServiceTest", $this->reflectionService
      ->getClassShortName(__CLASS__));
  }
  public function testClassNamespaceName() {
    $this
      ->assertEquals("Doctrine\\Tests\\Common\\Persistence\\Mapping", $this->reflectionService
      ->getClassNamespace(__CLASS__));
  }
  public function testGetParentClasses() {
    $classes = $this->reflectionService
      ->getParentClasses(__CLASS__);
    $this
      ->assertTrue(count($classes) >= 1, "The test class " . __CLASS__ . " should have at least one parent.");
  }
  public function testGetParentClassesForAbsentClass() {
    $this
      ->setExpectedException('Doctrine\\Common\\Persistence\\Mapping\\MappingException');
    $this->reflectionService
      ->getParentClasses(__NAMESPACE__ . '\\AbsentClass');
  }
  public function testGetReflectionClass() {
    $class = $this->reflectionService
      ->getClass(__CLASS__);
    $this
      ->assertInstanceOf("ReflectionClass", $class);
  }
  public function testGetMethods() {
    $this
      ->assertTrue($this->reflectionService
      ->hasPublicMethod(__CLASS__, "testGetMethods"));
    $this
      ->assertFalse($this->reflectionService
      ->hasPublicMethod(__CLASS__, "testGetMethods2"));
  }
  public function testGetAccessibleProperty() {
    $reflProp = $this->reflectionService
      ->getAccessibleProperty(__CLASS__, "reflectionService");
    $this
      ->assertInstanceOf("ReflectionProperty", $reflProp);
    $reflProp = $this->reflectionService
      ->getAccessibleProperty(__CLASS__, "unusedPublicProperty");
    $this
      ->assertInstanceOf("Doctrine\\Common\\Reflection\\RuntimePublicReflectionProperty", $reflProp);
  }

}

Members