]> git.mxchange.org Git - core.git/blobdiff - framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php
Continued:
[core.git] / framework / main / tests / resolver / command / console / class_TestsConsoleCommandResolver.php
index 56a2940e1e270241eca6eb6e85c670b9c4cf260e..925bb04e83a948a5ae193681e9631c8320edfd17 100644 (file)
@@ -1,20 +1,21 @@
 <?php
 // Own namespace
-namespace CoreFramework\Tests\Resolver\Command;
+namespace Org\Mxchange\CoreFramework\Tests\Resolver\Command;
 
 // Import framework stuff
-use CoreFramework\Command\InvalidCommandException;
-use CoreFramework\Generic\EmptyVariableException;
-use CoreFramework\Manager\ManageableApplication;
-use CoreFramework\Resolver\Command\BaseCommandResolver;
-use CoreFramework\Resolver\Command\CommandResolver;
+use Org\Mxchange\CoreFramework\Command\InvalidCommandException;
+use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
+use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
+
+// Import SPL stuff
+use \InvalidArgumentException;
 
 /**
  * A command resolver for console commands
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -49,27 +50,25 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command
         * Creates an instance of a TestsConsole command resolver with a given default command
         *
         * @param       $commandName                            The default command we shall execute
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared command resolver instance
-        * @throws      EmptyVariableException          Thrown if default command is not set
+        * @throws      InvalidArgumentException                Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public static final function createTestsConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+       public static final function createTestsConsoleCommandResolver ($commandName) {
                // Create the new instance
                $resolverInstance = new TestsConsoleCommandResolver();
 
                // Is the variable $commandName set and the command is valid?
                if (empty($commandName)) {
                        // Then thrown an exception here
-                       throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid('CoreFramework\Tests\Command', $commandName) === false) {
+                       throw new InvalidArgumentException('Parameter "commandName" is empty');
+               } elseif ($resolverInstance->isCommandValid('Org\Mxchange\CoreFramework\Tests\Command', $commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
 
-               // Set the application instance
-               $resolverInstance->setApplicationInstance($applicationInstance);
-               $resolverInstance->setNamespace('CoreFramework\Tests\Command');
+               // Set namespace for command
+               $resolverInstance->setNamespace('Org\Mxchange\CoreFramework\Tests\Command');
 
                // Return the prepared instance
                return $resolverInstance;