Changeset 158
- Timestamp:
- 01/26/07 00:24:04 (2 years ago)
- Files:
-
- trunk/src/main/php/_test (added)
- trunk/src/main/php/_test/README (added)
- trunk/src/main/php/_test/WithStatic.php (added)
- trunk/src/main/php/net/stubbles/stubClassLoader.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/stubClassLoaderTestCase.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/stubClassLoader.php
r97 r158 55 55 self::$classNames[$nqClassName] = $fqClassName; 56 56 require $dirName . '/' . self::mapClassname($fqClassName); 57 58 if (method_exists($nqClassName, '__static') == true) { 59 call_user_func(array($nqClassName, '__static')); 60 } 57 61 } 58 62 } trunk/src/test/php/net/stubbles/stubClassLoaderTestCase.php
r98 r158 1 1 <?php 2 2 /** 3 * Tests for stubClassLoader3 * Tests for net.stubbles.stubClassLoader 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> … … 8 8 */ 9 9 /** 10 * Tests for stubClassLoader10 * Tests for net.stubbles.stubClassLoader 11 11 * 12 12 * @package stubbles … … 24 24 $this->assertEqual(stubClassLoader::getNonQualifiedClassName('stubClassLoader'), 'stubClassLoader'); 25 25 } 26 27 /** 28 * assert that __static is called, but only once 29 */ 30 public function testStatic() 31 { 32 $this->assertFalse(class_exists('WithStatic', false)); 33 stubClassLoader::load('_test.WithStatic'); 34 $this->assertEqual(WithStatic::getCalled(), 1); 35 $this->assertTrue(class_exists('WithStatic', false)); 36 $this->assertEqual(stubClassLoader::getFullQualifiedClassName('WithStatic'), '_test.WithStatic'); 37 $this->assertEqual(stubClassLoader::getNonQualifiedClassName('_test.WithStatic'), 'WithStatic'); 38 stubClassLoader::load('_test.WithStatic'); 39 $this->assertEqual(WithStatic::getCalled(), 1); 40 } 26 41 } 27 42 ?>
