Skip to content

Commit

Permalink
Merge pull request #995 from sjinks/annotations_adapter_1.2.2
Browse files Browse the repository at this point in the history
[1.2.2] AnnotationsAdapter getProperty error
  • Loading branch information
Phalcon committed Aug 5, 2013
2 parents a2c5980 + 2c43eab commit 7915b80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/annotations/adapter.c
Expand Up @@ -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);
Expand Down
17 changes: 16 additions & 1 deletion unit-tests/AnnotationsAdaptersTest.php
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}

}
}

0 comments on commit 7915b80

Please sign in to comment.