Changeset 277

Show
Ignore:
Timestamp:
02/19/07 15:18:12 (2 years ago)
Author:
mikey
Message:

added unit test for net.stubbles.websites.stubPage

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/stubPage.php

    r267 r277  
    4949        $this->properties = $properties; 
    5050    } 
     51     
     52    /** 
     53     * checks whether a property for the page exists 
     54     * 
     55     * @param   string  $name  name of the property 
     56     * @return  bool 
     57     */ 
     58    public function hasProperty($name) 
     59    { 
     60        return isset($this->properties[$name]); 
     61    } 
    5162 
    5263    /** 
    53      * returns the property 
     64     * returns the property or null if it does not exist 
    5465     * 
    55      * @param   string  $name  name of the property 
     66     * @param   string  $name  name of the property 
    5667     * @return  scalar 
    5768     */ 
    5869    public function getProperty($name) 
    5970    { 
    60         return $this->properties[$name]; 
     71        if (isset($this->properties[$name]) == true) { 
     72            return $this->properties[$name]; 
     73        } 
     74         
     75        return null; 
    6176    } 
    6277 
  • trunk/src/test/run.php

    r223 r277  
    3838        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/reflection/ReflectionTestSuite.php'); 
    3939        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/util/UtilTestSuite.php'); 
     40        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/websites/WebsitesTestSuite.php'); 
    4041        #$testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/websites/variantmanager/VariantManagerTestSuite.php'); 
    4142        $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/xml/XMLTestSuite.php');