Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from mickaelandrieu/added-smoke-tests
Added a section for testing when they migrate a page
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/content/1.7/development/architecture/migration-guide/testing.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
<?php | ||
|
||
namespace LegacyTests\Integration\PrestaShopBundle\Controller\Admin; | ||
// ... | ||
/** | ||
* @group demo | ||
* | ||
* To execute these tests: use "./vendor/bin/phpunit -c tests-legacy/phpunit-admin.xml --filter=SurvivalTest" command. | ||
*/ | ||
class SurvivalTest extends WebTestCase | ||
{ | ||
// [...] | ||
|
||
public function getDataProvider() | ||
{ | ||
return [ | ||
'symfony_route_of_page' => ['Page title', 'symfony_route_of_page'], | ||
// ... | ||
]; | ||
} | ||
} | ||
``` |