Enrise testfest
Upcoming SlideShare
Loading in...5
×
 

Enrise testfest

on

  • 929 views

Brief explanation on writing php unittests.

Brief explanation on writing php unittests.

Statistics

Views

Total Views
929
Slideshare-icon Views on SlideShare
928
Embed Views
1

Actions

Likes
1
Downloads
1
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Enrise testfest Enrise testfest Presentation Transcript

  • Enrise mini testfestfebruary - 2011
  • What is a Testfest? Fun gathering for PHP programmers and the like. Concentrating on writing unit tests. Making PHP better. Get your name into PHP credits. Drink free beer.∂ WHAT IS IN IT FOR ME?
  • What is OUR Testfest? Mini test fest (evening instead of a full day) Maybe more often? Maybe full days? You decide,..
  • How to write a test (1) Simple text file with a bit of PHP code Test each component separately One test per .PHPT file
  • How to write a test (2) Bug: bug1234.phpt Feature: <function>_basic.phpt Error: <function>_error.phpt Global: <extension><nr>.phpt∂ NAMING CONVENTIONS
  • How to write a test (3) --TEST-- --CREDITS-- --SKIPIF-- --FILE-- --EXPECT-- / --EXPECTF-- --CLEAN--∂ PHPT SECTIONS
  • How to write a test (4) --TEST-- Trivial "Hello World" test --FILE-- <?php echo "Hello World"?> --EXPECT-- Hello World∂ EXAMPLE TEST (test/basic/001.phpt)
  • How to write a test (5) --TEST-- Check if echo works --CREDITS-- Joshua Thijssen <jthijssen@enrise.com> # Enrise TestFest 2011-02-11 --FILE-- <?php echo "Hello World"?> --EXPECT-- Hello World∂ EXAMPLE TEST
  • How to run your tests (1)∂ HTTP://TESTFEST.ENRISE.COM
  • How to run your tests (2)
  • What to test? http://gcov.php.net/PHP_5_3/lcov_html/ DOM (67.8%) STANDARD (78.1%) IMAP (64.4%) OPENSSL (63.1%) FTP (60.0%) SQLITE (74.7%) SNMP (7.8%) ZIP (65.4%)∂ HIGHER CODE COVERAGE DOES NOT ALWAYS MEAN BETTER TESTS!
  • More information Check out the URL’s: http://qa.php.net/write-test.php http://qa.php.net/phpt_details.php http://gcov.php.net/∂ MORE INFO ABOUT PHP UNIT-TESTING
  • More information When in doubt, ask one us to help you!∂ WE ARE HERE TO HELP!
  • ∂ LET’S SQUASH SOME BUGS