Changeset 387
- Timestamp:
- 03/15/07 21:20:56 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/stubBaseObject.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/stubClassLoader.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/stubException.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/stubObject.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/stubSerializedObject.php (added)
- trunk/src/test/php/net/stubbles/stubBaseObjectTestCase.php (modified) (3 diffs)
- trunk/src/test/php/net/stubbles/stubExceptionTestCase.php (modified) (3 diffs)
- trunk/src/test/php/net/stubbles/stubSerializedObjectTestCase.php (added)
- trunk/src/test/php/net/stubbles/stubTestSuite.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/stubBaseObject.php
r331 r387 62 62 63 63 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; 64 76 } 65 77 trunk/src/main/php/net/stubbles/stubClassLoader.php
r221 r387 125 125 * every other class that should extend it 126 126 */ 127 stubClassLoader::load('net.stubbles.stubObject', 'net.stubbles.stub BaseObject', 'net.stubbles.stubException');127 stubClassLoader::load('net.stubbles.stubObject', 'net.stubbles.stubSerializedObject', 'net.stubbles.stubBaseObject', 'net.stubbles.stubException'); 128 128 ?> trunk/src/main/php/net/stubbles/stubException.php
r97 r387 19 19 * 20 20 * @return stubReflectionObject 21 * @XMLIgnore 21 22 */ 22 23 public function getClass() … … 52 53 * @param mixed $compare 53 54 * @return bool 55 * @XMLIgnore 54 56 */ 55 57 public function equals($compare) … … 60 62 61 63 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; 62 76 } 63 77 … … 78 92 * 79 93 * @return string 94 * @XMLIgnore 80 95 */ 81 96 public function __toString() trunk/src/main/php/net/stubbles/stubObject.php
r97 r387 45 45 46 46 /** 47 * returns a serialized representation of the class 48 * 49 * @return stubSerializedObject 50 */ 51 public function getSerialized(); 52 53 /** 47 54 * returns a string representation of the class 48 55 * trunk/src/test/php/net/stubbles/stubBaseObjectTestCase.php
r98 r387 1 1 <?php 2 2 /** 3 * Tests for stubBaseObject3 * Tests for net.stubbles.stubBaseObject 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> … … 29 29 } 30 30 /** 31 * Tests for stubBaseObject31 * Tests for net.stubbles.stubBaseObject 32 32 * 33 33 * @package stubbles … … 88 88 89 89 /** 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 /** 90 99 * assure that the __toString() method works correct 91 100 */ trunk/src/test/php/net/stubbles/stubExceptionTestCase.php
r98 r387 1 1 <?php 2 2 /** 3 * Tests for stubException3 * Tests for net.stubbles.stubException 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> … … 23 23 } 24 24 /** 25 * Tests for stubException25 * Tests for net.stubbles.stubException 26 26 * 27 27 * @package stubbles … … 79 79 $this->assertFalse($this->stubException2->equals(new stub2stubException())); 80 80 } 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 } 81 90 } 82 91 ?> trunk/src/test/php/net/stubbles/stubTestSuite.php
r168 r387 26 26 $this->addTestFile($dir . '/stubExceptionTestCase.php'); 27 27 $this->addTestFile($dir . '/stubChainedExceptionTestCase.php'); 28 $this->addTestFile($dir . '/stubSerializedObjectTestCase.php'); 28 29 } 29 30 }
