remove one of addPlugin() (eg. DebugKit) from Application::bootstrap()
add another addPlugin() to Application::bootstrap()
do not modify ApplicationTest::testBootstrap()
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.
This is a (multiple allowed):
[x] bug
[ ] enhancement
[ ] feature-discussion (RFC)
CakePHP Application Skeleton Version: 4.3.0
What you did
addPlugin()
(eg.DebugKit
) fromApplication::bootstrap()
addPlugin()
toApplication::bootstrap()
ApplicationTest::testBootstrap()
What happened
Test pass.
What you expected to happen
Test fails asserting that plugin
DebugKit
is added.Cause
PluginCollection::get()
inApplicationTest::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.