Skip to content

Commit

Permalink
Fix global plugin path regression added in 2.6.3
Browse files Browse the repository at this point in the history
Merge branch 'davehensley-master' into master which fixes the regression
added in 2.6.3, which was trying to fix paths for composer based
installs.

Fixes #6125
  • Loading branch information
markstory committed Mar 21, 2015
2 parents 744952e + 5a6a74e commit 07de23a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 0 additions & 2 deletions lib/Cake/Console/Command/Task/PluginTask.php
@@ -1,7 +1,5 @@
<?php
/**
* The Plugin Task handles creating an empty plugin, ready to be used
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Core/App.php
Expand Up @@ -875,10 +875,12 @@ protected static function _packageFormat() {
'Vendor' => array(
'%s' . 'Vendor' . DS,
ROOT . DS . 'vendors' . DS,
dirname(dirname(CAKE)) . DS . 'vendors' . DS
),
'Plugin' => array(
APP . 'Plugin' . DS,
ROOT . DS . 'plugins' . DS
ROOT . DS . 'plugins' . DS,
dirname(dirname(CAKE)) . DS . 'plugins' . DS
)
);
}
Expand Down
16 changes: 11 additions & 5 deletions lib/Cake/Test/Case/Console/Command/Task/PluginTaskTest.php
Expand Up @@ -58,7 +58,7 @@ public function setUp() {
array_splice($paths, $i, 1);
}
}
$this->_testPath = array_push($paths, TMP . 'tests' . DS);
$this->_testPath = array_push($paths, TMP . 'tests' . DS) - 1;
App::build(array('plugins' => $paths));
}

Expand All @@ -80,17 +80,23 @@ public function tearDown() {
* @return void
*/
public function testBakeFoldersAndFiles() {
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue($this->_testPath));
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue('y'));
$this->Task->expects($this->at(0))
->method('in')
->will($this->returnValue($this->_testPath));
$this->Task->expects($this->at(1))
->method('in')
->will($this->returnValue('y'));

$path = $this->Task->path . 'BakeTestPlugin';

$file = $path . DS . 'Controller' . DS . 'BakeTestPluginAppController.php';
$this->Task->expects($this->at(2))->method('createFile')
$this->Task->expects($this->at(2))
->method('createFile')
->with($file, new PHPUnit_Framework_Constraint_IsAnything());

$file = $path . DS . 'Model' . DS . 'BakeTestPluginAppModel.php';
$this->Task->expects($this->at(3))->method('createFile')
$this->Task->expects($this->at(3))
->method('createFile')
->with($file, new PHPUnit_Framework_Constraint_IsAnything());

$this->Task->bake('BakeTestPlugin');
Expand Down

0 comments on commit 07de23a

Please sign in to comment.