zendframework / zf2-documentation

Zend Framework 2 documentation sources
BSD 3-Clause "New" or "Revised" License
190 stars 571 forks source link

Bootstrap class for functionally testing controllers is not required #1538

Open vitorbrandao opened 8 years ago

vitorbrandao commented 8 years ago

Documentation page Unit Testing a Zend Framework 2 application suggests the creation of a Bootstrap class where the ZF2 App is initialized. However by extending AbstractHttpControllerTestCase as seen on the same page the application config is set again and the App initialized again which makes Bootstrap useless.

A simple vendor/autoload.php file used as bootstrap in conjunction with AbstractHttpControllerTestCase is enough IMO.

stefanotorresi commented 8 years ago

:+1: for this change, since we are also in the process of removing the old test bootstrap from the various components in favor of vendor/autoload.php in zendframework/zendframework#7660 (where applicable).

Ocramius commented 8 years ago

Argh, I thought the bootstrap class already died ages ago. Kill it with fire!