Skip to content

Improving the MVP of a start-up (study project): upgrade & fix code, implement authorizations & automated tests

License

Notifications You must be signed in to change notification settings

AnnaigJegourel/OC-P8-Todo

Repository files navigation

OC-P8-Todo

Training program "Back-end Developer: PHP/Symfony" (OpenClassrooms)
Project 8: Upgrade an existing project (study project)

✅ Validated on June 14, 2023

Codacy Badge Maintainability

Configuration / Technologies ⚙️

xamppserver
MySQL / MariaDB
PHP 8.1
Symfony 5.4

Installation 🧑🏻‍🔧

Importing the repository

  1. Clone the repository to work on your localhost.

  2. To install the dependencies, run the following command at the root of the project:

    composer intall
    

Configuring the database

  1. Launch xamppserver, configure your php version.

  2. Create the database running:

    php bin/console doctrine:database:create
    
  3. Import its structure using this command:

    php bin/console doctrine:schema:update --force
    
  4. You can also load the fixtures as initial set of data:

    php bin/console doctrine:fixtures:load
    

Launching the project

  1. Launch the Symfony server running:

    symfony server:start
    

🎉 Congrats! You can now watch at the project in your navigator following the link given in your terminal, mostly: https://localhost:8000/

Working on tests 🧑🏽‍🔬

Set up the environment

  1. Once your project is installed as described above, you should have PHPUnit, phpunit-bridge (in the project, running composer) & x-debug (in Xampp) ready.

  2. Configure your .env.test file to access the test data in your database.

  3. Create the test database & its tables running:

    php bin/console doctrine:database:create
    
    php bin/console doctrine:schema:update --force
    
  4. Then load the test fixtures:

    php bin/console doctrine:fixtures:load
    

Review the existing tests

Create and modify tests

  • Write your code in tests/

  • To execute all tests, run the following command:

    php vendor/bin/phpunit
    
  • Generate the test coverage report running:

    php vendor/bin/phpunit --coverage-html public/test-coverage
    

About

Improving the MVP of a start-up (study project): upgrade & fix code, implement authorizations & automated tests

Topics

Resources

License

Stars

Watchers

Forks