Openclasrooms PHP/Symfony project 8 : PhpUnit
Developper : AureDev
Developped with : PHPStorm, WAMP64, PHPUnit, BlackFire
Languages : html, css, javascript, Symfony, Doctrine, Twig
Clone the github project
Create a mysql database and name it "project8_db" (php bin/console doctrine:database:create)
Update the DATABASE_URL in your .env file
Run a Doctrine migration to create the tables (php bin/console make:migration and php bin/console doctrine:migrations:migrate)
Load a couple of fake tasks with the fixtures load (php bin/console doctrine:fixtures:load)
Run the app on your localhost with the Symfony developpement server ! (cd project -> php bin/console server:run)
Controllers :
- All Controllers belong to themes. UserController belong to User functions, TaskController belong to Task functions, etc.
- Clean the controllers. A function must be clean and therefor you can make a service callable for a function, DO IT ! (like forms)
Security :
- Login is secured with Symfony Guard
- Some functions are secured with Voters to check user permissions
Tests :
- There are no UserFixtures. So if you want to load the successfull tests you need to adapt the tests or create 3 user profiles.
- pseudotestadmin:[email protected]:ROLE_ADMIN
- pseudotest:[email protected]:ROLE_USER
- pseudotest2PhpUnit:[email protected]:ROLE_ADMIN
CODE FUN !