From ba1371e000ce435f7a66831ac789a5f95052e443 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Sun, 4 Aug 2013 11:15:03 +0300 Subject: [PATCH 1/2] Fix typo in the method name (cherry picked from commit a3a5dcbefe8f5901c804354b6fe25bc233a5115c) --- ext/annotations/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/annotations/adapter.c b/ext/annotations/adapter.c index 5369c4f12f0..df0ceeeb39a 100644 --- a/ext/annotations/adapter.c +++ b/ext/annotations/adapter.c @@ -320,7 +320,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter, getProperty){ if (Z_TYPE_P(class_annotations) == IS_OBJECT) { PHALCON_INIT_VAR(properties); - phalcon_call_method(properties, class_annotations, "getpropertyannotations"); + phalcon_call_method(properties, class_annotations, "getpropertiesannotations"); if (Z_TYPE_P(properties) == IS_ARRAY) { phalcon_is_iterable(properties, &ah0, &hp0, 0, 0); From 2c43eab0b0e276d5b00496cd45ce6ab2d79eb419 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Sun, 4 Aug 2013 11:25:48 +0300 Subject: [PATCH 2/2] Test case (cherry picked from commit c13b970685b851ca8ca97eaa08574037f0623c82) --- unit-tests/AnnotationsAdaptersTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/unit-tests/AnnotationsAdaptersTest.php b/unit-tests/AnnotationsAdaptersTest.php index b8f09770f85..d956b234ea1 100644 --- a/unit-tests/AnnotationsAdaptersTest.php +++ b/unit-tests/AnnotationsAdaptersTest.php @@ -48,6 +48,11 @@ public function testMemoryAdapter() $this->assertTrue(is_object($classAnnotations)); $this->assertEquals(get_class($classAnnotations), 'Phalcon\Annotations\Reflection'); $this->assertEquals(get_class($classAnnotations->getClassAnnotations()), 'Phalcon\Annotations\Collection'); + + $property = $adapter->getProperty('TestClass', 'testProp1'); + $this->assertTrue(is_object($property)); + $this->assertEquals(get_class($property), 'Phalcon\Annotations\Collection'); + $this->assertEquals($property->count(), 4); } public function testFilesAdapter() @@ -108,6 +113,11 @@ public function testApcAdapter() $this->assertTrue(is_object($classAnnotations)); $this->assertEquals(get_class($classAnnotations), 'Phalcon\Annotations\Reflection'); $this->assertEquals(get_class($classAnnotations->getClassAnnotations()), 'Phalcon\Annotations\Collection'); + + $property = $adapter->getProperty('TestClass', 'testProp1'); + $this->assertTrue(is_object($property)); + $this->assertEquals(get_class($property), 'Phalcon\Annotations\Collection'); + $this->assertEquals($property->count(), 4); } @@ -139,6 +149,11 @@ public function testXcacheAdapter() $this->assertTrue(is_object($classAnnotations)); $this->assertEquals(get_class($classAnnotations), 'Phalcon\Annotations\Reflection'); $this->assertEquals(get_class($classAnnotations->getClassAnnotations()), 'Phalcon\Annotations\Collection'); + + $property = $adapter->getProperty('TestClass', 'testProp1'); + $this->assertTrue(is_object($property)); + $this->assertEquals(get_class($property), 'Phalcon\Annotations\Collection'); + $this->assertEquals($property->count(), 4); } -} \ No newline at end of file +}