Skip to content
Permalink
Browse files

Update more tests to not call App::build()

It doesn't do much anymore anyways.
  • Loading branch information...
markstory committed Sep 8, 2013
1 parent 098b735 commit 272c9d1803495dde9bbb8ad2dd2e0e9248d27ed5
@@ -96,8 +96,6 @@ public function setUp() {
*/
public function tearDown() {
unset($this->Task);
ClassRegistry::flush();
App::build();
parent::tearDown();
}
@@ -252,9 +252,6 @@ public function testExtractMultiplePaths() {
*/
public function testExtractExcludePlugins() {
Configure::write('App.namespace', 'TestApp');
App::build(array(
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/')
));
$this->out = $this->getMock('Cake\Console\ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('Cake\Console\ConsoleInput', array(), array(), '', false);
$this->Task = $this->getMock('Cake\Console\Command\Task\ExtractTask',
@@ -281,9 +278,6 @@ public function testExtractExcludePlugins() {
*/
public function testExtractPlugin() {
Configure::write('App.namespace', 'TestApp');
App::build(array(
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/')
));
$this->out = $this->getMock('Cake\Console\ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('Cake\Console\ConsoleInput', array(), array(), '', false);
@@ -310,10 +304,6 @@ public function testExtractPlugin() {
*/
public function testExtractModelValidation() {
Configure::write('App.namespace', 'TestApp');
App::build(array(
'Model' => array(CAKE . 'Test/TestApp/Model/'),
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/')
), App::RESET);
Plugin::load('TestPlugin');
$this->out = $this->getMock('Cake\Console\ConsoleOutput', array(), array(), '', false);
@@ -361,9 +351,6 @@ public function testExtractModelValidation() {
*/
public function testExtractModelValidationInPlugin() {
Configure::write('App.namespace', 'TestApp');
App::build(array(
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/')
));
Plugin::load('TestPlugin');
$this->out = $this->getMock('Cake\Console\ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('Cake\Console\ConsoleInput', array(), array(), '', false);
@@ -59,7 +59,6 @@ public function setUp() {
}
}
$this->_testPath = array_push($paths, TMP . 'tests/');
App::build(array('Plugin' => $paths));
}
/**
@@ -102,11 +102,6 @@ public function testGetThemePath() {
* @return void
*/
public function testGenerate() {
App::build(array(
'Console' => array(
CAKE . 'Test/TestApp/Console/'
)
));
$this->Task->initialize();
$this->Task->expects($this->any())->method('in')->will($this->returnValue(1));
@@ -122,12 +117,6 @@ public function testGenerate() {
* @return void
*/
public function testGenerateWithTemplateFallbacks() {
App::build(array(
'Console' => array(
CAKE . 'Test/TestApp/Console/',
CAKE_CORE_INCLUDE_PATH . DS . 'console/'
)
));
$this->Task->initialize();
$this->Task->params['theme'] = 'test';
$this->Task->set(array(
@@ -588,9 +588,6 @@ public function testBakeWithPlugin() {
*/
public function testInteractiveWithPlugin() {
$testApp = CAKE . 'Test/TestApp/Plugin/';
App::build(array(
'Plugin' => array($testApp)
), App::RESET);
Plugin::load('TestPlugin');
$this->Task->plugin = 'TestPlugin';
@@ -113,27 +113,9 @@ class ShellDispatcherTest extends TestCase {
*/
public function setUp() {
parent::setUp();
App::build(array(
'Plugin' => array(
CAKE . 'Test/TestApp/Plugin/'
),
'Console/Command' => array(
CAKE . 'Test/TestApp/Console/Command/'
)
), App::RESET);
Plugin::load('TestPlugin');
}
/**
* tearDown method
*
* @return void
*/
public function tearDown() {
parent::tearDown();
Plugin::unload();
}
/**
* testParseParams method
*
@@ -166,10 +166,6 @@ public function testConstruct() {
* @return void
*/
public function testInitialize() {
App::build(array(
'Plugin' => array(CAKE . 'Test/TestApp/Plugin/'),
'Model' => array(CAKE . 'Test/TestApp/Model/')
), App::RESET);
Configure::write('App.namespace', 'TestApp');
Plugin::load('TestPlugin');
@@ -186,8 +182,6 @@ public function testInitialize() {
$this->assertTrue(isset($this->Shell->Comment));
$this->assertInstanceOf('TestApp\Model\Comment', $this->Shell->Comment);
$this->assertEquals('TestApp\Model\Comment', $this->Shell->modelClass);
App::build();
}
/**
@@ -196,10 +190,6 @@ public function testInitialize() {
* @return void
*/
public function testLoadModel() {
App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Plugin' . DS),
'Model' => array(CAKE . 'Test' . DS . 'TestApp' . DS . 'Model' . DS)
), App::RESET);
Configure::write('App.namespace', 'TestApp');
$Shell = new MergeShell();
@@ -212,9 +202,6 @@ public function testLoadModel() {
$this->assertTrue(isset($this->Shell->TestPluginPost));
$this->assertInstanceOf('TestPlugin\Model\TestPluginPost', $this->Shell->TestPluginPost);
$this->assertEquals('TestPluginPost', $this->Shell->modelClass);
App::build();
Plugin::unload('TestPlugin');
}
/**

0 comments on commit 272c9d1

Please sign in to comment.
You can’t perform that action at this time.