[Argil-svn] SF.net SVN: argil: [516] branches/experimental
Status: Alpha
Brought to you by:
tswicegood
|
From: <tsw...@us...> - 2007-04-05 03:14:14
|
Revision: 516
http://argil.svn.sourceforge.net/argil/?rev=516&view=rev
Author: tswicegood
Date: 2007-04-04 20:14:15 -0700 (Wed, 04 Apr 2007)
Log Message:
-----------
Add getProperty() method
Modified Paths:
--------------
branches/experimental/src/Argil/Reflection/Object.php
branches/experimental/tests/Argil/Reflection/ObjectTest.php
Modified: branches/experimental/src/Argil/Reflection/Object.php
===================================================================
--- branches/experimental/src/Argil/Reflection/Object.php 2007-04-01 18:40:08 UTC (rev 515)
+++ branches/experimental/src/Argil/Reflection/Object.php 2007-04-05 03:14:15 UTC (rev 516)
@@ -1,5 +1,6 @@
<?php
+require_once 'Argil/Reflection/Property.php';
require_once 'Argil/Reflection/PropertyList.php';
class Argil_Reflection_Object
@@ -23,4 +24,10 @@
$this->_decorated->getProperties()
);
}
+
+ public function getProperty($name) {
+ return new Argil_Reflection_Property(
+ $this->_decorated->getProperty($name)
+ );
+ }
}
\ No newline at end of file
Modified: branches/experimental/tests/Argil/Reflection/ObjectTest.php
===================================================================
--- branches/experimental/tests/Argil/Reflection/ObjectTest.php 2007-04-01 18:40:08 UTC (rev 515)
+++ branches/experimental/tests/Argil/Reflection/ObjectTest.php 2007-04-05 03:14:15 UTC (rev 516)
@@ -22,4 +22,13 @@
$this->assertIsA($properties[0], 'Argil_Reflection_Property');
}
+
+ public function testReturnsANamedProperty() {
+ $reflection = new Argil_Reflection_Object(
+ new ArgilSampleReflectionObject()
+ );
+
+ $property = $reflection->getProperty('publicProperty');
+ $this->assertIsA($property, 'Argil_Reflection_Property');
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|