Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 15, 2024
1 parent 10eb535 commit cfdd682
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@
"require": {
"php": ">=8.1",
"cakephp/bake": "^3.0.4",
"cakephp/cakephp": "^5.0.0",
"cakephp/cakephp": "^5.0.7",
"phpstan/phpdoc-parser": "^1.7",
"sebastian/diff": "^5.0 || ^6.0",
"squizlabs/php_codesniffer": "^3.7"
},
"require-dev": {
"cakephp/cakephp": "^5.1.0",
"dereuromark/cakephp-shim": "^3.3.0",
"cakephp/migrations": "^4.0.1",
"cakephp/plugin-installer": "^2.0.1",
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Generator/Task/PluginTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace IdeHelper\Test\TestCase\Generator\Task;

use Cake\Core\Configure;
use Cake\TestSuite\TestCase;
use IdeHelper\Generator\Task\PluginTask;

Expand Down Expand Up @@ -42,6 +43,9 @@ public function testCollect() {
'Migrations' => '\Cake\Http\BaseApplication::class',
'Shim' => '\Cake\Http\BaseApplication::class',
];
if (version_compare(Configure::version(), '5.1.0', '<')) {
$expected = [];
}
$this->assertSame($expected, $map);
}

Expand Down
17 changes: 16 additions & 1 deletion tests/TestCase/Generator/Task/TranslationKeyTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testCollect() {
return (string)$className;
}, $list);

// 'my_plugin' is now superseeded by 'my_namespace/my_plugin'
// 'my_plugin' is now superseded by 'my_namespace/my_plugin'
$expected = [
'awesome' => '\'awesome\'',
'cake' => '\'cake\'',
Expand All @@ -81,6 +81,21 @@ public function testCollect() {
'relations' => '\'relations\'',
'shim' => '\'shim\'',
];
if (version_compare(Configure::version(), '5.1.0', '<')) {
$expected = [
'awesome' => '\'awesome\'',
'bake' => '\'bake\'',
'cake' => '\'cake\'',
'cake/twig_view' => '\'cake/twig_view\'',
'controllers' => '\'controllers\'',
'ide_helper' => '\'ide_helper\'',
'migrations' => '\'migrations\'',
'my_namespace/my_plugin' => '\'my_namespace/my_plugin\'',
'relations' => '\'relations\'',
'shim' => '\'shim\'',
];
}

$this->assertSame($expected, $list);
}

Expand Down
14 changes: 4 additions & 10 deletions tests/test_files/meta/phpstorm/.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
override(
\Cake\Console\ConsoleIo::helper(0),
map([
'Banner' => \Cake\Command\Helper\BannerHelper::class,
'Progress' => \Cake\Command\Helper\ProgressHelper::class,
'Table' => \Cake\Command\Helper\TableHelper::class,
]),
Expand All @@ -88,6 +87,7 @@
'My',
'MyController',
'MyOther',
'RequestHandler',
);

override(
Expand All @@ -100,6 +100,7 @@
'MyController' => \TestApp\Controller\Component\MyControllerComponent::class,
'MyNamespace/MyPlugin.My' => \MyNamespace\MyPlugin\Controller\Component\MyComponent::class,
'MyOther' => \TestApp\Controller\Component\MyOtherComponent::class,
'Shim.RequestHandler' => \Shim\Controller\Component\RequestHandlerComponent::class,
]),
);

Expand Down Expand Up @@ -148,10 +149,7 @@
override(
\Cake\Core\PluginApplicationInterface::addPlugin(0),
map([
'Bake' => \Cake\Http\BaseApplication::class,
'Cake/TwigView' => \Cake\Http\BaseApplication::class,
'Migrations' => \Cake\Http\BaseApplication::class,
'Shim' => \Cake\Http\BaseApplication::class,

]),
);

Expand Down Expand Up @@ -1346,11 +1344,6 @@
'Shim',
'Shim.deprecations',
'debug',
'plugins',
'plugins.Bake',
'plugins.Cake/TwigView',
'plugins.Migrations',
'plugins.Shim',
);

registerArgumentsSet(
Expand Down Expand Up @@ -1421,6 +1414,7 @@
'created',
'id',
'name',
'params',
);

registerArgumentsSet(
Expand Down

0 comments on commit cfdd682

Please sign in to comment.