Changeset 89
- Timestamp:
- 02/08/07 21:57:53 (2 years ago)
- Files:
-
- trunk/examples/ClassLoader.php (modified) (2 diffs)
- trunk/examples/DynamicSetterClass.php (modified) (1 diff)
- trunk/examples/MyCollector.php (modified) (1 diff)
- trunk/examples/Registry.php (added)
- trunk/examples/TestEmptyConstructor.php (modified) (1 diff)
- trunk/examples/TestStaticClass.php (modified) (2 diffs)
- trunk/examples/TestXInclude.php (modified) (2 diffs)
- trunk/tests/integration (added)
- trunk/tests/integration/Example1TestCase.php (added)
- trunk/tests/integration/Example2TestCase.php (added)
- trunk/tests/integration/Example3TestCase.php (added)
- trunk/tests/integration/ExampleClassLoaderTestCase.php (added)
- trunk/tests/integration/ExampleCollectionTestCase.php (added)
- trunk/tests/integration/ExampleExtensionTestCase.php (added)
- trunk/tests/integration/TestAttributesRequiredTestCase.php (added)
- trunk/tests/integration/TestCDataSetterTestCase.php (added)
- trunk/tests/integration/TestConstructorTestCase.php (added)
- trunk/tests/integration/TestDynamicSettersTestCase.php (added)
- trunk/tests/integration/TestDynamicTypesTestCase.php (added)
- trunk/tests/integration/TestEmptyConstructorTestCase.php (added)
- trunk/tests/integration/TestInterfacesTestCase.php (added)
- trunk/tests/integration/TestPrimitivesFactoryTestCase.php (added)
- trunk/tests/integration/TestPrimitivesTestCase.php (added)
- trunk/tests/integration/TestStaticClassTestCase.php (added)
- trunk/tests/integration/TestXIncludeTestCase.php (added)
- trunk/tests/runIntegration.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/examples/ClassLoader.php
r46 r89 20 20 public function loadClass($fqClassName) 21 21 { 22 require str_replace('.', '/', $fqClassName) . '.php';22 require_once str_replace('.', '/', $fqClassName) . '.php'; 23 23 } 24 24 … … 31 31 { 32 32 $className = explode('.', $fqClassName); 33 return $className[count($className) - 1];33 return $className[count($className) - 1]; 34 34 } 35 35 } trunk/examples/DynamicSetterClass.php
r43 r89 7 7 $this->foo = $foo; 8 8 } 9 10 public function getFoo() 11 { 12 return $this->foo; 13 } 9 14 10 15 public function setBar($bar) { 11 16 $this->bar = $bar; 12 17 } 18 19 public function getBar() 20 { 21 return $this->bar; 22 } 13 23 } 14 24 ?> trunk/examples/MyCollector.php
r53 r89 20 20 * @var array<MyInterface> 21 21 */ 22 private $bar = array(); 23 24 /** 25 * set bar 26 * 27 * @param MyInterface $bar 28 */ 29 public function addBar(MyInterface $bar) 30 { 31 $this->bar[] = $bar; 32 } 22 private $bar = array(); 23 24 /** 25 * set bar 26 * 27 * @param MyInterface $bar 28 */ 29 public function addBar(MyInterface $bar) 30 { 31 $this->bar[] = $bar; 32 } 33 34 public function getBar() 35 { 36 return $this->bar; 37 } 33 38 } 34 39 ?> trunk/examples/TestEmptyConstructor.php
r57 r89 7 7 8 8 require 'EmptyConstructorClass.php'; 9 require 'ColorPrimitives.php';10 9 /** 11 10 * @author Stephan Schmidt <stephan.schmidt@schlund.de> trunk/examples/TestStaticClass.php
r77 r89 5 5 ); 6 6 error_reporting(E_ALL | E_STRICT); 7 7 require 'Registry.php'; 8 8 /** 9 9 * @author Stephan Schmidt <stephan.schmidt@schlund.de> … … 30 30 } 31 31 } 32 33 /**34 * Very simple registry class35 *36 * @package XJConfForPHP37 * @subpackage examples38 */39 class Registry {40 protected static $values = array();41 42 public static function setFoo($foo) {43 self::$values['foo'] = $foo;44 }45 46 public static function setBar($bar) {47 self::$values['bar'] = $bar;48 }49 50 public static function export() {51 return self::$values;52 }53 }54 55 32 TestStaticClass::main(); 56 33 ?> trunk/examples/TestXInclude.php
r18 r89 11 11 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 12 12 */ 13 class Test Primitives13 class TestXInclude 14 14 { 15 15 … … 39 39 } 40 40 } 41 Test Primitives::main();41 TestXInclude::main(); 42 42 ?>
