Changeset 1503

Show
Ignore:
Timestamp:
04/06/08 01:43:54 (1 month ago)
Author:
mikey
Message:

return empty arrays if source not set

Files:

Legend:

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

    r1362 r1503  
    7676    public function getCacheVars() 
    7777    { 
     78        if (null === $this->source) { 
     79            return array(); 
     80        } 
     81         
    7882        return array('source' => $this->source); 
    7983    } 
     
    8690    public function getUsedFiles() 
    8791    { 
     92        if (null === $this->source) { 
     93            return array(); 
     94        } 
     95         
    8896        return array($this->source); 
    8997    } 
  • trunk/src/test/php/net/stubbles/websites/memphis/stubMemphisIncludeFilePageElementTestCase.php

    r1500 r1503  
    7373    public function cachingMethods() 
    7474    { 
    75         $this->assertEquals(array('source' => null), $this->includeFilePageElement->getCacheVars()); 
    76         $this->assertEquals(array(null), $this->includeFilePageElement->getUsedFiles()); 
     75        $this->assertEquals(array(), $this->includeFilePageElement->getCacheVars()); 
     76        $this->assertEquals(array(), $this->includeFilePageElement->getUsedFiles()); 
    7777        $this->includeFilePageElement->setSource(TEST_SRC_PATH . '/resources/contentFile.txt'); 
    7878        $this->assertEquals(array('source' => TEST_SRC_PATH . '/resources/contentFile.txt'), $this->includeFilePageElement->getCacheVars());