Symfony2. Unit testing by Vadim Kharitonov
Upcoming SlideShare
Loading in...5
×
 

Symfony2. Unit testing by Vadim Kharitonov

on

  • 219 views

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

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

Statistics

Views

Total Views
219
Views on SlideShare
219
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Symfony2. Unit testing by Vadim Kharitonov Symfony2. Unit testing by Vadim Kharitonov Presentation Transcript

  • SYMFONY2. PHPUNITVadim Kharitonov
  • 1.INSTALLATION
  • 1.1OSPACKAGE # apt-get install phpunit View slide
  • 1.2PHPUNIT.PHAR $ wget https://phar.phpunit.de/phpunit.phar $ chmod +x phpunit.phar View slide
  • 1.3COMPOSER $ ./composer.phar require 'phpunit/phpunit=4.1.*'
  • 1.4PEAR # pear config-set auto_discover 1 # pear install pear.phpunit.de/PHPUnit
  • 2.LET'SBATTLE
  • 2.1ENTITY
  • ENTITYUSER
  • TESTSENTITYUSERTEST
  • 2.2REPOSITORY
  • COMPOSER.JSON
  • APPKERNEL
  • CONFIG_TEST.YML
  • REPOSITORYUSERREPOSITORY
  • TESTSREPOSITORYUSERREPOSITORY TEST
  • TESTSREPOSITORYFIXTURESLOADU SERDATA
  • 2.3CONTROLLER
  • CONTROLLERDEMOCONTROLLER
  • TESTSCONTROLLERDEMOCONTROLL ERTEST
  • 2.4CONSOLECOMMANDS
  • COMMANDHELLOWORLDCOMMAND
  • TESTSCOMMANDHELLOWORLDCOM MANDTEST
  • 2.5FORMS
  • FORMUSERTYPE
  • TESTSFORMUSERTYPETEST
  • 2.6EXTENSIONS
  • DEPENDENCYINJECTIONCONFIGURAT ION
  • DEPENDENCYINJECTIONACMEDEMOE XTENSION
  • TESTSDEPENDENCYINJECTIONACME DEMOEXTENSIONTEST
  • 2.7EVENTLISTENERS
  • EVENTLISTENERSUSERNOTIFIERLISTE NER
  • EVENTSUSEREVENT
  • RESOURCESCONFIGSERVICES.XML
  • TESTSEVENTLISTENERSUSERNOTIFIE RLISTENERTEST
  • 2.8TWIGEXTENSIONS
  • RESOURCESCONFIGSERVICES.XML
  • TWIGEXTENSIONSQREXTENSION
  • TESTSTWIGEXTENSIONSQREXTENSI ONTEST
  • TESTSTWIGEXTENSIONFIXTURESFI LTERSSQR.TEST
  • TWIGEXTENSIONUSEREXTENSION
  • TESTSTWIGEXTENSIONUSEREXTEN SIONTEST
  • 3.CODECHARACTERISTICS What percentage of the code coverage do u have?
  • 3.1.CODECOVERAGE
  • $ bin/phpunit -c app --coverage-text
  • $ bin/phpunit -c app --coverage- html=../report
  • 3.2PHPCOPY/PASTE DETECTOR $ wget https://phar.phpunit.de/phpcpd.phar $ chmod +x phpcpd.phar $ ./phpcpd.phar --exclude="*Test" src