cakephp / app

CakePHP application template
366 stars 390 forks source link

ApplicationTest::testBootstrap() doesn't test existence of each plugin #867

Closed nishimura-d closed 2 years ago

nishimura-d commented 2 years ago

This is a (multiple allowed):

What you did

What happened

Test pass.

What you expected to happen

Test fails asserting that plugin DebugKit is added.

Cause

PluginCollection::get() in ApplicationTest::testBootstrap() creates the plugin if not added. If we just remove a plugin, assertCount() will fail, but if we add another plugin to match the count, it will pass.

Proposal

How about asserting PluginCollection::has()? If we assert existence of each plugin, it is not needed to assert the count I think.

ADmad commented 2 years ago

Your proposal sounds good. Would you like to make a pull request with the suggested changes?