Skip to content

Files

Latest commit

 

History

History
43 lines (34 loc) · 2.55 KB

README.md

File metadata and controls

43 lines (34 loc) · 2.55 KB

php-best-practices

PHP

Symfony

Api Platform

WIP

Doctrine2

Coming in doctrine3

  • Final methods will be possible in Doctrine3

Sources

PHPUnit

  • Use PHPUnit Mocks instead of Prophecy https://medium.com/@IvanChepurnyi/native-mocking-and-stubbing-in-php-ad11a32596e4
  • Isolate your functionals tests thank to a group annotation (@group functional)
  • Never mock the class / trait / interface you are testing on its test class. For a trait or interface, use a DummObject which implements the interface or uses the trait
  • Don't test your privates methods unless they are complex