Symfony2. Unit testing by Vadim Kharitonov

536 views

Published on

Minsk Symfony: встреча в Марте

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
536
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Symfony2. Unit testing by Vadim Kharitonov

  1. 1. SYMFONY2. PHPUNITVadim Kharitonov
  2. 2. 1.INSTALLATION
  3. 3. 1.1OSPACKAGE # apt-get install phpunit
  4. 4. 1.2PHPUNIT.PHAR $ wget https://phar.phpunit.de/phpunit.phar $ chmod +x phpunit.phar
  5. 5. 1.3COMPOSER $ ./composer.phar require 'phpunit/phpunit=4.1.*'
  6. 6. 1.4PEAR # pear config-set auto_discover 1 # pear install pear.phpunit.de/PHPUnit
  7. 7. 2.LET'SBATTLE
  8. 8. 2.1ENTITY
  9. 9. ENTITYUSER
  10. 10. TESTSENTITYUSERTEST
  11. 11. 2.2REPOSITORY
  12. 12. COMPOSER.JSON
  13. 13. APPKERNEL
  14. 14. CONFIG_TEST.YML
  15. 15. REPOSITORYUSERREPOSITORY
  16. 16. TESTSREPOSITORYUSERREPOSITORY TEST
  17. 17. TESTSREPOSITORYFIXTURESLOADU SERDATA
  18. 18. 2.3CONTROLLER
  19. 19. CONTROLLERDEMOCONTROLLER
  20. 20. TESTSCONTROLLERDEMOCONTROLL ERTEST
  21. 21. 2.4CONSOLECOMMANDS
  22. 22. COMMANDHELLOWORLDCOMMAND
  23. 23. TESTSCOMMANDHELLOWORLDCOM MANDTEST
  24. 24. 2.5FORMS
  25. 25. FORMUSERTYPE
  26. 26. TESTSFORMUSERTYPETEST
  27. 27. 2.6EXTENSIONS
  28. 28. DEPENDENCYINJECTIONCONFIGURAT ION
  29. 29. DEPENDENCYINJECTIONACMEDEMOE XTENSION
  30. 30. TESTSDEPENDENCYINJECTIONACME DEMOEXTENSIONTEST
  31. 31. 2.7EVENTLISTENERS
  32. 32. EVENTLISTENERSUSERNOTIFIERLISTE NER
  33. 33. EVENTSUSEREVENT
  34. 34. RESOURCESCONFIGSERVICES.XML
  35. 35. TESTSEVENTLISTENERSUSERNOTIFIE RLISTENERTEST
  36. 36. 2.8TWIGEXTENSIONS
  37. 37. RESOURCESCONFIGSERVICES.XML
  38. 38. TWIGEXTENSIONSQREXTENSION
  39. 39. TESTSTWIGEXTENSIONSQREXTENSI ONTEST
  40. 40. TESTSTWIGEXTENSIONFIXTURESFI LTERSSQR.TEST
  41. 41. TWIGEXTENSIONUSEREXTENSION
  42. 42. TESTSTWIGEXTENSIONUSEREXTEN SIONTEST
  43. 43. 3.CODECHARACTERISTICS What percentage of the code coverage do u have?
  44. 44. 3.1.CODECOVERAGE
  45. 45. $ bin/phpunit -c app --coverage-text
  46. 46. $ bin/phpunit -c app --coverage- html=../report
  47. 47. 3.2PHPCOPY/PASTE DETECTOR $ wget https://phar.phpunit.de/phpcpd.phar $ chmod +x phpcpd.phar $ ./phpcpd.phar --exclude="*Test" src

×