September 2016
Intermediate to advanced
1091 pages
21h 41m
English
The great thing about the auto-generate CRUD tool is that it generates even the functional tests for us. More specifically, in this case, it generated the CategoryControllerTest.php and ProductControllerTest.php files within the src/Foggyline/CatalogBundle/Tests/Controller/ directory.
Auto-generated functional tests have a commented out methods within class body. This throws an error during the phpunit run. We need to at least define a dummy test method in them to allow phpunit to overlook them.
If we look into these two files, we can see that they both have a single testCompleteScenario method defined, which is entirely commented out. Let's go ahead and change the CategoryControllerTest.php content as follows:
// Create a new ...
Read now
Unlock full access