diff --git a/src/content/1.7/development/architecture/migration-guide/_index.md b/src/content/1.7/development/architecture/migration-guide/_index.md index 37dddd6180..4c12e49fc8 100644 --- a/src/content/1.7/development/architecture/migration-guide/_index.md +++ b/src/content/1.7/development/architecture/migration-guide/_index.md @@ -27,6 +27,7 @@ This is the list of items that usually need to be done in order to complete the - Checks permissions and demo mode constraints - Re-introduce hooks (and document the missing one if you can't for a good reason) - Complete `Link` class to map PrestaShop menu to the new page + - Create the smoke/survival tests for the migrated page - Deletions - Remove the old controller in `controllers/admin/Admin*.php` - Remove related old templates (in `admin-dev/themes/default/template/controllers/*`) diff --git a/src/content/1.7/development/architecture/migration-guide/clean-up.md b/src/content/1.7/development/architecture/migration-guide/clean-up.md index 66e2393f0d..41a86f42c1 100644 --- a/src/content/1.7/development/architecture/migration-guide/clean-up.md +++ b/src/content/1.7/development/architecture/migration-guide/clean-up.md @@ -10,4 +10,3 @@ Once everything is migrated, refactored, extracted to specific classes and worki * Delete the old controller. * Delete the old templates (delete the `admin-dev/themes/default/template/controller/{name}` folder. * Delete the related "legacy tests". - diff --git a/src/content/1.7/development/architecture/migration-guide/testing.md b/src/content/1.7/development/architecture/migration-guide/testing.md new file mode 100644 index 0000000000..6f4e7582d1 --- /dev/null +++ b/src/content/1.7/development/architecture/migration-guide/testing.md @@ -0,0 +1,43 @@ +--- +title: Testing +weight: 70 +--- + +# Testing + +You are encouraged to add both unit and functional tests for every new class +you have created. + +You **must** add a smoke test (also called "survival") for every new page +you migrate. + +## Smoke testing + +A smoke test is a really simple and basic test that ensure the page will load with +the right HTTP code. This won't ensure the page will works as expected **but** if the test fails, this ensure the page is not functional. + +To add a new test, you need to add a new entry in the Data Provider of SurvivalTest class: + +```php + ['Page title', 'symfony_route_of_page'], + // ... + ]; + } +} +```