|
@@ 211-232 (lines=22) @@
|
| 208 |
|
$this->assertSame(apc_fetch('KF_CLASSMAP'), Loader::readAutoloadingMapApc()); |
| 209 |
|
} |
| 210 |
|
|
| 211 |
|
public function testMethodaddMapping() |
| 212 |
|
{ |
| 213 |
|
$class = 'addToMappingClass'; |
| 214 |
|
$file = realpath(__DIR__ . '/fixtures/notloaded/addToMapping.php'); |
| 215 |
|
|
| 216 |
|
$this->assertTrue(Loader::addMapping($class, $file)); |
| 217 |
|
|
| 218 |
|
// test if the entry was added to the autoloader class map array |
| 219 |
|
$map = Loader::getAutoloaderClassMap(); |
| 220 |
|
// entry exists |
| 221 |
|
$this->assertTrue(true, array_key_exists($class, $map)); |
| 222 |
|
// compare entries |
| 223 |
|
$this->assertEquals($map[$class], $file); |
| 224 |
|
|
| 225 |
|
// file not loaded, just mapped |
| 226 |
|
#$this->assertFalse(class_exists($class, false)); |
| 227 |
|
|
| 228 |
|
// triggering autoload via class_exists |
| 229 |
|
// --- WARNING --- |
| 230 |
|
// The "Koch Framework Autoloader" needs to be registered BEFORE "Composers Autoloader". |
| 231 |
|
$this->assertTrue(class_exists($class, true)); |
| 232 |
|
} |
| 233 |
|
|
| 234 |
|
public function testMethodincludeFileAndMap() |
| 235 |
|
{ |
|
@@ 234-250 (lines=17) @@
|
| 231 |
|
$this->assertTrue(class_exists($class, true)); |
| 232 |
|
} |
| 233 |
|
|
| 234 |
|
public function testMethodincludeFileAndMap() |
| 235 |
|
{ |
| 236 |
|
$file = realpath(__DIR__ . '/fixtures/includeFileAndMap.php'); |
| 237 |
|
$class = 'includeFileAndMapClass'; |
| 238 |
|
|
| 239 |
|
Loader::includeFileAndMap($file, $class); |
| 240 |
|
|
| 241 |
|
// test if the entry was added to the autoloader class map array |
| 242 |
|
$map = Loader::getAutoloaderClassMap(); |
| 243 |
|
|
| 244 |
|
$this->assertTrue(true, array_key_exists($class, $map)); |
| 245 |
|
|
| 246 |
|
$this->assertEquals($map[$class], $file); |
| 247 |
|
|
| 248 |
|
// file already loaded |
| 249 |
|
$this->assertTrue(class_exists($class, false)); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
public function testMethodincludeFile() |
| 253 |
|
{ |