qa:testfesttalk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qa:testfesttalk [2009/04/05 08:31] – run one test dabaseqa:testfesttalk [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHPT roundup talk ====== ====== PHPT roundup talk ======
-This wikipage contains all extra information for the talk prepared for phptestfest 2009. They heavily rely on content written by other people before. Every resource of the talk, even the slides (in different formats) will be in this place. Other testfesters can use and modify this talk to save precious time.+This wikipage contains all extra information for the talk prepared for [[qa:testfest-2009|phptestfest 2009]]. They heavily rely on content written by other people before. Every resource of the talk, even the slides (in different formats) will be in this place. Other testfesters can use and modify this talk to save precious time. 
 + 
 +[[http://tinyurl.com/c9bqf4]] 
  
 ===== How is PHP Tested ===== ===== How is PHP Tested =====
Line 19: Line 21:
   * autoconf   * autoconf
   * gcc   * gcc
-  * bison or flex+  * flex-old 
   * libxml2-dev   * libxml2-dev
   * re2c   * re2c
-  * lcov+  * Bison (before php 5.2)  
 +  * lcov / ggcov
  
  
Line 128: Line 131:
 </code> </code>
  
-==== Single Test ====+==== Single Tests ==== 
 +It is possible to execute a single test or tests residing in one directory. Again run-tests.php helps here.  
 + 
 +A single Test 
 +<code> 
 +php run-tests.php tests/func/test010.phpt 
 +</code> 
 + 
 +A directory with tests  
 +<code> 
 +php run-tests.php tests/func/ 
 +</code> 
 + 
 +===== Write Tests ===== 
 +From here on it's easy to add own tests.  
 + 
 +<code> 
 +--TEST-- 
 +Hello world test 
 +--FILE-- 
 +<?php 
 +echo "Hello"; 
 +?> 
 +--CLEAN-- 
 +--EXPECT-- 
 +Hello 
 +</code> 
 ===== Write good Tests... ===== ===== Write good Tests... =====
 There are certain guidelines you can follow when writing tests. There are several guidelines that you can follow to get working test code that is solid and makes sense.  There are certain guidelines you can follow when writing tests. There are several guidelines that you can follow to get working test code that is solid and makes sense. 
Line 221: Line 251:
   * Split into several smaller tests   * Split into several smaller tests
  
-==== Lazy Test ==== 
-// 
-This occurs when several test methods check the same  
-method using the same fixture (but for example check the  
-values of different instance variables). Such tests often only  
-have meaning when considering them together so they are  
-easier to use when joined using Inline Method (F:117).//  
- 
-Examples 
-  * Several Tests have the same parameters but different checks on return values 
- 
-Avoid by 
-  * group the tests together 
  
  
qa/testfesttalk.1238920317.txt.gz · Last modified: 2017/09/22 13:28 (external edit)