OSDN Git Service

fix uppercase and lowercase autoloading v1.0.3
authorfrostbane <frostbane@programmer.net>
Mon, 9 Dec 2019 07:21:44 +0000 (16:21 +0900)
committerfrostbane <frostbane@programmer.net>
Mon, 9 Dec 2019 07:21:44 +0000 (16:21 +0900)
for the win (or lose) users

src/autoloader/Psr0.php
test/RegisterLowerCase.php

index 3804218..78b7cad 100644 (file)
@@ -97,6 +97,7 @@ class Psr0
 
         $pathName       = $namespace . "\\";
         $classPathNames = array_unique(array($pathName . ucfirst($className),
+                                             $pathName . lcfirst($className),
                                              $pathName . $className,
                                        ));
 
index 0366451..d19f165 100644 (file)
@@ -53,7 +53,7 @@ class RegisterLowerCase
     /* ***************************************************************** */
 
     public function
-    testRegisterString()
+    testRegisterUppercase()
     {
         $this->loader->registerPath(__DIR__ . "/fixture/classes");
 
@@ -62,6 +62,16 @@ class RegisterLowerCase
         $this->assertNotNull($minidatafile);
     }
 
+    public function
+    testRegisterLowerCase()
+    {
+        $this->loader->registerPath(__DIR__ . "/fixture/classes");
+
+        $minidatafile = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\picoData");
+
+        $this->assertNotNull($minidatafile);
+    }
+
     /* ***************************************************************** */
     /*                                                                   */
     /* ***************************************************************** */