Browse Source

Add a setAppNamespace() convenience function to replace literal calls

Marc Würth 8 years ago
parent
commit
cd02266aef
1 changed files with 11 additions and 0 deletions
  1. 11 0
      src/TestSuite/TestCase.php

+ 11 - 0
src/TestSuite/TestCase.php

@@ -676,4 +676,15 @@ abstract class TestCase extends BaseTestCase
 
         return $mock;
     }
+
+    /**
+     * Set the app namespace
+     *
+     * @param string $appNamespace The app namespace, defaults to "TestApp".
+     * @return void
+     */
+    public static function setAppNamespace($appNamespace = 'TestApp')
+    {
+        Configure::write('App.namespace', $appNamespace);
+    }
 }