3
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
* This software consists of voluntary contributions made by many individuals
16
* and is licensed under the MIT license. For more information, see
17
* <http://www.doctrine-project.org>.
20
namespace Doctrine\Tests\Common\Persistence\Mapping;
22
use Doctrine\Common\Persistence\Mapping\StaticReflectionService;
27
class StaticReflectionServiceTest extends \PHPUnit_Framework_TestCase
29
private $reflectionService;
31
public function setUp()
33
$this->reflectionService = new StaticReflectionService();
36
public function testShortname()
38
$this->assertEquals("StaticReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__));
41
public function testClassNamespaceName()
43
$this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__));
46
public function testGetParentClasses()
48
$classes = $this->reflectionService->getParentClasses(__CLASS__);
49
$this->assertTrue(count($classes) == 0, "The test class ".__CLASS__." should have no parents according to static reflection.");
52
public function testGetReflectionClass()
54
$class = $this->reflectionService->getClass(__CLASS__);
55
$this->assertNull($class);
58
public function testGetMethods()
60
$this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods"));
61
$this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2"));
64
public function testGetAccessibleProperty()
66
$reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService");
67
$this->assertNull($reflProp);