From cd02266aef78ddb0d1858f42eeaf1c7e9c4bf196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Thu, 15 Jun 2017 14:23:32 +0200 Subject: [PATCH] Add a setAppNamespace() convenience function to replace literal calls --- src/TestSuite/TestCase.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php index 5f5b40abe9d..886ebaa90d9 100644 --- a/src/TestSuite/TestCase.php +++ b/src/TestSuite/TestCase.php @@ -676,4 +676,15 @@ public function getMockForModel($alias, array $methods = [], array $options = [] 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); + } }