mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix global plugin path regression added in 2.6.3
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
This commit is contained in:
commit
07de23a692
3 changed files with 14 additions and 8 deletions
|
@ -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)
|
||||
*
|
||||
|
|
|
@ -875,10 +875,12 @@ class App {
|
|||
'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
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class PluginTaskTest extends CakeTestCase {
|
|||
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));
|
||||
}
|
||||
|
||||
|
@ -80,17 +80,23 @@ class PluginTaskTest extends CakeTestCase {
|
|||
* @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');
|
||||
|
|
Loading…
Reference in a new issue