OSDN Git Service

add unit tests
authorfrostbane <frostbane@programmer.net>
Mon, 9 Dec 2019 04:50:41 +0000 (13:50 +0900)
committerfrostbane <frostbane@programmer.net>
Mon, 9 Dec 2019 06:03:42 +0000 (15:03 +0900)
16 files changed:
.gitignore [new file with mode: 0644]
README.md [new file with mode: 0644]
phpunit.xml [new file with mode: 0644]
src/autoloader/Psr0.php
test/Miscellaneous.php [new file with mode: 0644]
test/RegisterLowerCase.php [new file with mode: 0644]
test/RegisterPath.php [new file with mode: 0644]
test/RegisterUnderscorePath.php [new file with mode: 0644]
test/UnregisterPath.php [new file with mode: 0644]
test/fixture/classes/DataNoPrefix/MiniData.php [new file with mode: 0644]
test/fixture/classes/DataNoPrefix/Text/MilliData.php [new file with mode: 0644]
test/fixture/classes/DataNoPrefix/picoData.php [new file with mode: 0644]
test/fixture/classes/DataPrefix/MicroData.php [new file with mode: 0644]
test/fixture/utility/UtilNoPrefix/Compare/MilliUtil.php [new file with mode: 0644]
test/fixture/utility/UtilNoPrefix/MiniUtil.php [new file with mode: 0644]
test/fixture/utility/UtilNoPrefix/String_Util/Search/PicoUtil.php [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..c32e7e2
--- /dev/null
@@ -0,0 +1,46 @@
+# syntax:glob
+
+# project files
+.idea/*
+*.sublime-*
+.viproj*
+.vimproj*
+.project
+.vscode/*
+*.iml
+
+# temporary directories and 3rd party source code directories
+tmp/*
+var/*
+cache/*
+log/*
+logs/*
+docs/*
+dev/.zim/*
+vendor/*
+
+# temporary files
+*.tmp
+*.bak
+*.orig
+*.tmp
+
+# npm generated files/folders
+node_modules/*
+npm-debug.log
+package-lock.json
+
+# composer/phpunit generated files/folders
+composer.phar
+composer.lock
+.phpunit.result.cache
+
+# system generated files
+.buildpath
+.settings
+.DS_Store
+Thumbs.db
+desktop.ini
+
+# project specific
+src/public/assets/scripts/vendor/*
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..a8b778d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Autoloader #
+
+----------------------------------------------------------------------
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644 (file)
index 0000000..5f89cc1
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="vendor/autoload.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="true">
+  <testsuites>
+    <testsuite name="autoloader unit tests">
+      <directory suffix=".php">./test/</directory>
+      <exclude>./test/utility</exclude>
+      <exclude>./test/fixture</exclude>
+    </testsuite>
+  </testsuites>
+  <filter>
+    <whitelist>
+      <directory suffix=".php">./src</directory>
+      <exclude>
+        <directory>./src/tmp</directory>
+        <directory>./test</directory>
+        <directory>./vendor</directory>
+      </exclude>
+    </whitelist>
+  </filter>
+  <logging>
+    <log type="coverage-text"
+         target="php://stdout"
+         showUncoveredFiles="true" />
+    <log type="coverage-clover"
+         target="logs/clover.xml" />
+  </logging>
+</phpunit>
index f8469d6..519cf81 100644 (file)
@@ -12,6 +12,11 @@ class Psr0
      */
     private static $__instance;
 
+    /**
+     * @codeCoverageIgnore
+     *
+     * Psr0 constructor.
+     */
     private function __construct()
     {
         $this->__paths      = array();
@@ -19,6 +24,8 @@ class Psr0
     }
 
     /**
+     * @codeCoverageIgnore
+     *
      * @return Psr0
      */
     public static function instance()
@@ -28,6 +35,14 @@ class Psr0
         return static::$__instance;
     }
 
+    /**
+     * @codeCoverageIgnore
+     *
+     * @param string $namespace
+     * @param string $className
+     *
+     * @return array
+     */
     private function __explodeUnderscores(&$namespace, &$className)
     {
         $parts     = explode("_", $className);
@@ -47,6 +62,13 @@ class Psr0
         );
     }
 
+    /**
+     * @codeCoverageIgnore
+     *
+     * @param string $className
+     *
+     * @return array
+     */
     private function __getNamespaceAndClass(&$className)
     {
         $parts     = explode("\\", $className);
@@ -63,24 +85,40 @@ class Psr0
         );
     }
 
+    /**
+     * @codeCoverageIgnore
+     *
+     * @param string $fullClassName
+     *
+     * @return null|string
+     */
     private function __findClassFile($fullClassName)
     {
         list($namespace, $className) =
             $this->__getNamespaceAndClass($fullClassName);
 
         $pathName       = str_replace("\\", DIRECTORY_SEPARATOR, $namespace . "\\");
-        $classPathNames = array(
-            $pathName . ucfirst($className),
-            $pathName . $className,
-        );
+        $classPathNames = array_unique(array(
+                                           $pathName . ucfirst($className),
+                                           $pathName . $className,
+                                       ));
 
         foreach ($classPathNames as $classPathName) {
-            foreach ($this->__paths as &$p) {
+            foreach ($this->__paths as $p) {
+                if (is_array($p)) {
+                    $prefix = array_keys($p)[0];
+                    $p      = $p[$prefix];
+
+                    if (substr($classPathName, 0, strlen($prefix)) !== $prefix) {
+                        continue;
+                    }
+
+                    $className = substr($className, strlen($prefix));
+                }
+
                 $file = $p . $classPathName . ".php";
-                //\ChromePhp::info("loading '$fullClassName' from '$file'.");
 
                 if (file_exists($file)) {
-                    //\ChromePhp::info("    found '$fullClassName' at '$file'.");
                     return $file;
                 }
             }
@@ -89,6 +127,15 @@ class Psr0
         return null;
     }
 
+    /**
+     * If you are calling this method then probably you have a
+     * problem. Try seeing a physician or go to the nearest mental
+     * facility.
+     *
+     * @codeCoverageIgnore
+     *
+     * @param $fullClassName
+     */
     public function autoload($fullClassName)
     {
         $file = $this->__findClassFile($fullClassName);
@@ -96,22 +143,45 @@ class Psr0
         !empty($file) and require_once $file;
     }
 
+    /**
+     * @codeCoverageIgnore
+     *
+     * @param string[] $paths
+     *
+     * @return array
+     */
     private function __filterTrimPaths(array &$paths)
     {
         return array_map(function ($p) {
             return rtrim($p, "/\\") . DIRECTORY_SEPARATOR;
         }, array_filter($paths, function ($p) {
-            return !empty($p);
+            return !empty($p) && is_string($p);
         }));
     }
 
     /**
      * add path to autoload path(s)
      *
+     * @codeCoverageIgnore
+     *
      * @param string|array $path Root path
+     *
+     * @deprecated register will be removed in future versions, use
+     *             registerPath instead
      */
     public function register($path)
     {
+        $this->registerPath($path);
+    }
+
+    /**
+     * add path to autoload path(s)
+     *
+     * @param string|array $path Root path
+     *
+     */
+    public function registerPath($path)
+    {
         if (!$this->__registered) {
             spl_autoload_register(array($this, "autoload"));
 
@@ -127,10 +197,26 @@ class Psr0
     /**
      * remove path to autoload path(s)
      *
+     * @codeCoverageIgnore
+     *
      * @param string|array $path Root path
+     *
+     * @deprecated unregister will be removed in future versions, use
+     *             unregisterPath instead
      */
     public function unregister($path)
     {
+        $this->unregisterPath($path);
+    }
+
+    /**
+     * remove path to autoload path(s)
+     *
+     * @param string|array $path Root path
+     *
+     */
+    public function unregisterPath($path)
+    {
         if (!$this->__registered) {
             spl_autoload_register(array($this, "autoload"));
 
@@ -139,14 +225,38 @@ class Psr0
 
         !is_array($path) and $path = array($path);
 
-        $trimmedPaths    = $this->__filterTrimPaths($path);
-        $this->__paths[] = array_diff($this->__paths, $trimmedPaths);
+        $trimmedPaths  = $this->__filterTrimPaths($path);
+        $this->__paths = array_diff($this->__paths, $trimmedPaths);
+    }
+
+    public function registerNamespacePath($namspace)
+    {
+        throw new \Exception("unimplemented");
+    }
+
+    public function unregisterNamespacePath($namspace)
+    {
+        throw new \Exception("unimplemented");
+    }
+
+    /**
+     * clear all the search paths
+     *
+     * @return array cleared paths
+     */
+    public function clearPaths()
+    {
+        $paths         = $this->__paths;
+        $this->__paths = array();
+
+        return $paths;
     }
 
-    public function debugPaths()
+    /**
+     * @return array
+     */
+    public function getPaths()
     {
-        print "<pre>";
-        print_r($this->__paths);
-        print "</pre>";
+        return $this->__paths;
     }
 }
diff --git a/test/Miscellaneous.php b/test/Miscellaneous.php
new file mode 100644 (file)
index 0000000..8c34dc0
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+
+namespace frostbane\autoloader\test;
+
+use frostbane\autoloader\Psr0;
+use PHPUnit_Framework_TestCase;
+
+class Miscellaneous
+    extends PHPUnit_Framework_TestCase
+{
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    /**
+     * @var Psr0
+     */
+    private $loader;
+
+    /**
+     * @var \ReflectionMethod
+     */
+    private $findClassFile;
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public static function
+    setUpBeforeClass()
+    {
+        $loader = Psr0::instance();
+
+        $rexl = new \ReflectionProperty($loader, "__registered");
+
+        $rexl->setAccessible(true);
+        $rexl->setValue($loader, true);
+    }
+
+    public function
+    setUp()
+    {
+        $this->loader = Psr0::instance();
+
+        $this->findClassFile = new \ReflectionMethod($this->loader, "__findClassFile");
+
+        $this->findClassFile->setAccessible(true);
+
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    testInstance()
+    {
+        $loader = Psr0::instance();
+
+        $this->assertInstanceOf("frostbane\\autoloader\\Psr0", $loader);
+    }
+
+    public function
+    testClearPaths()
+    {
+        $paths         = array(__DIR__ . "/fixture/classes",
+                               __DIR__ . "/fixture/utility");
+        $miniDataClass = "DataNoPrefix\\MiniData";
+        $miniUtilClass = "UtilNoPrefix\\MiniUtil";
+
+        $this->loader->registerPath($paths);
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNotNull($minidatapath);
+        $this->assertNotNull($miniutilpath);
+
+        $this->loader->clearPaths();
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNull($minidatapath);
+        $this->assertNull($miniutilpath);
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    tearDown()
+    {
+    }
+
+    public static function
+    tearDownAfterClass()
+    {
+    }
+}
diff --git a/test/RegisterLowerCase.php b/test/RegisterLowerCase.php
new file mode 100644 (file)
index 0000000..0366451
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+
+namespace frostbane\autoloader\test;
+
+use frostbane\autoloader\Psr0;
+use PHPUnit_Framework_TestCase;
+
+class RegisterLowerCase
+    extends PHPUnit_Framework_TestCase
+{
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    /**
+     * @var Psr0
+     */
+    private $loader;
+
+    /**
+     * @var \ReflectionMethod
+     */
+    private $findClassFile;
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public static function
+    setUpBeforeClass()
+    {
+        $loader = Psr0::instance();
+
+        $rexl = new \ReflectionProperty($loader, "__registered");
+
+        $rexl->setAccessible(true);
+        $rexl->setValue($loader, true);
+    }
+
+    public function
+    setUp()
+    {
+        $this->loader = Psr0::instance();
+
+        $this->findClassFile = new \ReflectionMethod($this->loader, "__findClassFile");
+
+        $this->findClassFile->setAccessible(true);
+
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    testRegisterString()
+    {
+        $this->loader->registerPath(__DIR__ . "/fixture/classes");
+
+        $minidatafile = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\PicoData");
+
+        $this->assertNotNull($minidatafile);
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    tearDown()
+    {
+        $this->loader->clearPaths();
+    }
+
+    public static function
+    tearDownAfterClass()
+    {
+    }
+}
+
diff --git a/test/RegisterPath.php b/test/RegisterPath.php
new file mode 100644 (file)
index 0000000..75473c7
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+
+namespace frostbane\autoloader\test;
+
+use frostbane\autoloader\Psr0;
+use PHPUnit_Framework_TestCase;
+
+class RegisterPath
+    extends PHPUnit_Framework_TestCase
+{
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    /**
+     * @var Psr0
+     */
+    private $loader;
+
+    /**
+     * @var \ReflectionMethod
+     */
+    private $findClassFile;
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public static function
+    setUpBeforeClass()
+    {
+        $loader = Psr0::instance();
+
+        $rexl = new \ReflectionProperty($loader, "__registered");
+
+        $rexl->setAccessible(true);
+        $rexl->setValue($loader, true);
+    }
+
+    public function
+    setUp()
+    {
+        $this->loader = Psr0::instance();
+
+        $this->findClassFile = new \ReflectionMethod($this->loader, "__findClassFile");
+
+        $this->findClassFile->setAccessible(true);
+
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    testRegisterEmptyPath()
+    {
+        $this->loader->registerPath(array("",
+                                          __DIR__ . "/fixture/classes",
+                                          null,
+                                          array()));
+
+        $minidatafile = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\MiniData");
+
+        $this->assertNotNull($minidatafile);
+
+        $paths = $this->loader->getPaths();
+
+        $this->assertEquals(1, count($paths));
+    }
+
+    public function
+    testRegisterString()
+    {
+        $this->loader->registerPath(__DIR__ . "/fixture/classes");
+
+        $minidatafile = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\MiniData");
+
+        $this->assertNotNull($minidatafile);
+    }
+
+    public function
+    testRegisterArray()
+    {
+        $this->loader->registerPath(array(__DIR__ . "/fixture/classes",
+                                          __DIR__ . "/fixture/utility"));
+
+        $minidatafile = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\MiniData");
+
+        $this->assertNotNull($minidatafile);
+
+        $miniutilfle = $this->findClassFile->invoke($this->loader, "UtilNoPrefix\\MiniUtil");
+
+        $this->assertNotNull($miniutilfle);
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    tearDown()
+    {
+        $this->loader->clearPaths();
+    }
+
+    public static function
+    tearDownAfterClass()
+    {
+    }
+}
diff --git a/test/RegisterUnderscorePath.php b/test/RegisterUnderscorePath.php
new file mode 100644 (file)
index 0000000..3f164d8
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+
+namespace frostbane\autoloader\test;
+
+use frostbane\autoloader\Psr0;
+use PHPUnit_Framework_TestCase;
+
+class RegisterUnderscorePath
+    extends PHPUnit_Framework_TestCase
+{
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    /**
+     * @var Psr0
+     */
+    private $loader;
+
+    /**
+     * @var \ReflectionMethod
+     */
+    private $findClassFile;
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public static function
+    setUpBeforeClass()
+    {
+        $loader = Psr0::instance();
+
+        $rexl = new \ReflectionProperty($loader, "__registered");
+
+        $rexl->setAccessible(true);
+        $rexl->setValue($loader, true);
+    }
+
+    public function
+    setUp()
+    {
+        $this->loader = Psr0::instance();
+
+        $this->findClassFile = new \ReflectionMethod($this->loader, "__findClassFile");
+
+        $this->findClassFile->setAccessible(true);
+
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    testRegisterString()
+    {
+        $this->loader->registerPath(__DIR__ . "/fixture/classes");
+
+        $millidata = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\Text_MilliData");
+
+        $this->assertNotNull($millidata);
+    }
+
+    public function
+    testRegisterArray()
+    {
+        $this->loader->registerPath(array(__DIR__ . "/fixture/classes",
+                                          __DIR__ . "/fixture/utility"));
+
+        $millidata = $this->findClassFile->invoke($this->loader, "DataNoPrefix\\Text_MilliData");
+
+        $this->assertNotNull($millidata);
+
+        $milliutil = $this->findClassFile->invoke($this->loader, "UtilNoPrefix\\Compare_MilliUtil");
+
+        $this->assertNotNull($milliutil);
+    }
+
+    public function
+    testRegisterUnderscoreNamespace()
+    {
+        $this->loader->registerPath(__DIR__ . "/fixture/utility");
+
+        $picoutil = $this->findClassFile->invoke($this->loader, "UtilNoPrefix\\String_Util\\Search_PicoUtil");
+
+        $this->assertNotNull($picoutil);
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    tearDown()
+    {
+        $this->loader->clearPaths();
+    }
+
+    public static function
+    tearDownAfterClass()
+    {
+    }
+}
diff --git a/test/UnregisterPath.php b/test/UnregisterPath.php
new file mode 100644 (file)
index 0000000..dd1dc56
--- /dev/null
@@ -0,0 +1,137 @@
+<?php
+
+namespace frostbane\autoloader\test;
+
+use frostbane\autoloader\Psr0;
+use PHPUnit_Framework_TestCase;
+
+class UnregisterPath
+    extends PHPUnit_Framework_TestCase
+{
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    /**
+     * @var Psr0
+     */
+    private $loader;
+
+    /**
+     * @var \ReflectionMethod
+     */
+    private $findClassFile;
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public static function
+    setUpBeforeClass()
+    {
+        $loader = Psr0::instance();
+
+        $rexl = new \ReflectionProperty($loader, "__registered");
+
+        $rexl->setAccessible(true);
+        $rexl->setValue($loader, true);
+    }
+
+    public function
+    setUp()
+    {
+        $this->loader = Psr0::instance();
+
+        $this->findClassFile = new \ReflectionMethod($this->loader, "__findClassFile");
+
+        $this->findClassFile->setAccessible(true);
+
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    testUnregisterString()
+    {
+        $path  = __DIR__ . "/fixture/classes";
+        $class = "DataNoPrefix\\MiniData";
+
+        $this->loader->registerPath($path);
+
+        $file = $this->findClassFile->invoke($this->loader, $class);
+
+        $this->assertNotNull($file);
+        $this->loader->unregisterPath($path);
+
+        $file = $this->findClassFile->invoke($this->loader, $class);
+
+        $this->assertNull($file);
+    }
+
+    public function
+    testUnregisterArray()
+    {
+        $paths         = array(__DIR__ . "/fixture/classes",
+                               __DIR__ . "/fixture/utility");
+        $miniDataClass = "DataNoPrefix\\MiniData";
+        $miniUtilClass = "UtilNoPrefix\\MiniUtil";
+
+        $this->loader->registerPath($paths);
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNotNull($minidatapath);
+        $this->assertNotNull($miniutilpath);
+
+        $this->loader->unregisterPath($paths);
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNull($minidatapath);
+        $this->assertNull($miniutilpath);
+    }
+
+    public function
+    testClearPaths()
+    {
+        $paths         = array(__DIR__ . "/fixture/classes",
+                               __DIR__ . "/fixture/utility");
+        $miniDataClass = "DataNoPrefix\\MiniData";
+        $miniUtilClass = "UtilNoPrefix\\MiniUtil";
+
+        $this->loader->registerPath($paths);
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNotNull($minidatapath);
+        $this->assertNotNull($miniutilpath);
+
+        $this->loader->clearPaths();
+
+        $minidatapath = $this->findClassFile->invoke($this->loader, $miniDataClass);
+        $miniutilpath = $this->findClassFile->invoke($this->loader, $miniUtilClass);
+
+        $this->assertNull($minidatapath);
+        $this->assertNull($miniutilpath);
+    }
+
+    /* ***************************************************************** */
+    /*                                                                   */
+    /* ***************************************************************** */
+
+    public function
+    tearDown()
+    {
+        $this->loader->clearPaths();
+    }
+
+    public static function
+    tearDownAfterClass()
+    {
+    }
+}
diff --git a/test/fixture/classes/DataNoPrefix/MiniData.php b/test/fixture/classes/DataNoPrefix/MiniData.php
new file mode 100644 (file)
index 0000000..485e142
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace DataNoPrefix;
+
+class MiniData
+{
+}
diff --git a/test/fixture/classes/DataNoPrefix/Text/MilliData.php b/test/fixture/classes/DataNoPrefix/Text/MilliData.php
new file mode 100644 (file)
index 0000000..c9ae0c6
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace DataNoPrefix;
+
+class Text_MilliData
+{
+}
diff --git a/test/fixture/classes/DataNoPrefix/picoData.php b/test/fixture/classes/DataNoPrefix/picoData.php
new file mode 100644 (file)
index 0000000..1378999
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace DataNoPrefix;
+
+class PicoData
+{
+}
diff --git a/test/fixture/classes/DataPrefix/MicroData.php b/test/fixture/classes/DataPrefix/MicroData.php
new file mode 100644 (file)
index 0000000..5b21508
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace fixture\prefix\Data;
+
+class MicroData
+{
+}
diff --git a/test/fixture/utility/UtilNoPrefix/Compare/MilliUtil.php b/test/fixture/utility/UtilNoPrefix/Compare/MilliUtil.php
new file mode 100644 (file)
index 0000000..2b03f6d
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace UtilNoPrefix;
+
+class Compare_MilliUtil
+{
+}
diff --git a/test/fixture/utility/UtilNoPrefix/MiniUtil.php b/test/fixture/utility/UtilNoPrefix/MiniUtil.php
new file mode 100644 (file)
index 0000000..0390ed6
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace UtilNoPrefix;
+
+class MiniUtil
+{
+}
diff --git a/test/fixture/utility/UtilNoPrefix/String_Util/Search/PicoUtil.php b/test/fixture/utility/UtilNoPrefix/String_Util/Search/PicoUtil.php
new file mode 100644 (file)
index 0000000..fca4645
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+namespace UtilNoPrefix\String_Util;
+
+class Search_PicoUtil
+{
+}