Skip to content

snoob/php-best-practices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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

About

Best practices for PHP / Symfony / Api Platform / Doctrine 2 and PHPUnit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published