Changeset 387

Show
Ignore:
Timestamp:
03/15/07 21:20:56 (1 year ago)
Author:
mikey
Message:

added net.stubbles.stubSerializedObject

Files:

Legend:

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

    r331 r387  
    6262         
    6363        return false; 
     64    } 
     65     
     66    /** 
     67     * returns a serialized representation of the class 
     68     *  
     69     * @return  stubSerializedObject 
     70     * @XMLIgnore 
     71     */ 
     72    public function getSerialized() 
     73    { 
     74        $serialized = new stubSerializedObject($this); 
     75        return $serialized; 
    6476    } 
    6577     
  • trunk/src/main/php/net/stubbles/stubClassLoader.php

    r221 r387  
    125125 * every other class that should extend it 
    126126 */ 
    127 stubClassLoader::load('net.stubbles.stubObject', 'net.stubbles.stubBaseObject', 'net.stubbles.stubException'); 
     127stubClassLoader::load('net.stubbles.stubObject', 'net.stubbles.stubSerializedObject', 'net.stubbles.stubBaseObject', 'net.stubbles.stubException'); 
    128128?> 
  • trunk/src/main/php/net/stubbles/stubException.php

    r97 r387  
    1919     * 
    2020     * @return  stubReflectionObject 
     21     * @XMLIgnore 
    2122     */ 
    2223    public function getClass() 
     
    5253     * @param   mixed  $compare 
    5354     * @return  bool 
     55     * @XMLIgnore 
    5456     */ 
    5557    public function equals($compare) 
     
    6062         
    6163        return false; 
     64    } 
     65     
     66    /** 
     67     * returns a serialized representation of the class 
     68     *  
     69     * @return  stubSerializedObject 
     70     * @XMLIgnore 
     71     */ 
     72    public function getSerialized() 
     73    { 
     74        $serialized = new stubSerializedObject($this); 
     75        return $serialized; 
    6276    } 
    6377     
     
    7892     * 
    7993     * @return  string 
     94     * @XMLIgnore 
    8095     */ 
    8196    public function __toString() 
  • trunk/src/main/php/net/stubbles/stubObject.php

    r97 r387  
    4545     
    4646    /** 
     47     * returns a serialized representation of the class 
     48     *  
     49     * @return  stubSerializedObject 
     50     */ 
     51    public function getSerialized(); 
     52     
     53    /** 
    4754     * returns a string representation of the class 
    4855     *  
  • trunk/src/test/php/net/stubbles/stubBaseObjectTestCase.php

    r98 r387  
    11<?php 
    22/** 
    3  * Tests for stubBaseObject 
     3 * Tests for net.stubbles.stubBaseObject 
    44 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    2929} 
    3030/** 
    31  * Tests for stubBaseObject 
     31 * Tests for net.stubbles.stubBaseObject 
    3232 * 
    3333 * @package     stubbles 
     
    8888     
    8989    /** 
     90     * assure that serialization delivers the correct class 
     91     */ 
     92    public function testGetSerialized() 
     93    { 
     94        $serialized = $this->stubBaseObject1->getSerialized(); 
     95        $this->assertIsA($serialized, 'stubSerializedObject'); 
     96    } 
     97     
     98    /** 
    9099     * assure that the __toString() method works correct 
    91100     */ 
  • trunk/src/test/php/net/stubbles/stubExceptionTestCase.php

    r98 r387  
    11<?php 
    22/** 
    3  * Tests for stubException 
     3 * Tests for net.stubbles.stubException 
    44 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    2323} 
    2424/** 
    25  * Tests for stubException 
     25 * Tests for net.stubbles.stubException 
    2626 * 
    2727 * @package     stubbles 
     
    7979        $this->assertFalse($this->stubException2->equals(new stub2stubException())); 
    8080    } 
     81     
     82    /** 
     83     * assure that serialization delivers the correct class 
     84     */ 
     85    public function testGetSerialized() 
     86    { 
     87        $serialized = $this->stubException1->getSerialized(); 
     88        $this->assertIsA($serialized, 'stubSerializedObject'); 
     89    } 
    8190} 
    8291?> 
  • trunk/src/test/php/net/stubbles/stubTestSuite.php

    r168 r387  
    2626        $this->addTestFile($dir . '/stubExceptionTestCase.php'); 
    2727        $this->addTestFile($dir . '/stubChainedExceptionTestCase.php'); 
     28        $this->addTestFile($dir . '/stubSerializedObjectTestCase.php'); 
    2829    } 
    2930}