Changeset 89

Show
Ignore:
Timestamp:
02/08/07 21:57:53 (2 years ago)
Author:
mikey
Message:

added integration tests using the existing examples

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/ClassLoader.php

    r46 r89  
    2020    public function loadClass($fqClassName) 
    2121    { 
    22         require str_replace('.', '/', $fqClassName) . '.php'; 
     22        require_once str_replace('.', '/', $fqClassName) . '.php'; 
    2323    } 
    2424     
     
    3131    { 
    3232        $className = explode('.', $fqClassName); 
    33            return $className[count($className) - 1]; 
     33        return $className[count($className) - 1]; 
    3434    } 
    3535} 
  • trunk/examples/DynamicSetterClass.php

    r43 r89  
    77        $this->foo = $foo; 
    88    } 
     9     
     10    public function getFoo() 
     11    { 
     12        return $this->foo; 
     13    } 
    914 
    1015    public function setBar($bar) { 
    1116        $this->bar = $bar; 
    1217    } 
     18     
     19    public function getBar() 
     20    { 
     21        return $this->bar; 
     22    } 
    1323} 
    1424?> 
  • trunk/examples/MyCollector.php

    r53 r89  
    2020     * @var  array<MyInterface> 
    2121     */ 
    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    } 
    3338} 
    3439?> 
  • trunk/examples/TestEmptyConstructor.php

    r57 r89  
    77 
    88require 'EmptyConstructorClass.php'; 
    9 require 'ColorPrimitives.php'; 
    109/** 
    1110 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
  • trunk/examples/TestStaticClass.php

    r77 r89  
    55); 
    66error_reporting(E_ALL | E_STRICT); 
    7  
     7require 'Registry.php'; 
    88/** 
    99 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
     
    3030    } 
    3131} 
    32  
    33 /** 
    34  * Very simple registry class 
    35  * 
    36  * @package XJConfForPHP 
    37  * @subpackage examples 
    38  */ 
    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  
    5532TestStaticClass::main(); 
    5633?> 
  • trunk/examples/TestXInclude.php

    r18 r89  
    1111 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
    1212 */ 
    13 class TestPrimitives 
     13class TestXInclude 
    1414{ 
    1515 
     
    3939    } 
    4040} 
    41 TestPrimitives::main(); 
     41TestXInclude::main(); 
    4242?>