Idea of “Recycle batteries” web application is to count amount of collected batteries. There is a box for used batteries and a computer near the box, with our web application. When someone brings old batteries – he throws them into the box and submit a form in application.
Form must contain fields: Battery Type, Count and Name. Name is not required field, even anonymous user can give us used batteries. After form is submitted, the record about added batteries is stored in tha database.
There must be a table on this page with two columns: Battery type and Total count
Test cases:
- Submit Battery form with 4 AA batteries (1)
- Submit Battery form with 3 AAA batteries (2)
- Submit Battery form with 1 AA battery (3)
- Open statistics page and check that there are 2 rows in the table, with counts: AA – 5, AAA – 3 (4-8)
# composer install
# php bin/console doctrine:database:create
# php bin/console doctrine:schema:update --force
# php bin/console server:run
vendor/bin/simple-phpunit
- Symfony Documentation - Forms
- Symfony2 Jobeet: Testing your forms
- PHPUnit Documentation
- and my lovely husband to wrap it up