Current file: D:\data\micmap\cgi-bin\dicfro\4.5\tests\AllTests.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
33.33%33.33%
33.33% 1 / 3 CRAP
9.09%9.09%
9.09% 1 / 11
 
AllTests
0.00%0.00%
0.00% 0 / 1
33.33%33.33%
33.33% 1 / 3
9.09%9.09%
9.09% 1 / 11
 main($files)
0.00%0.00%
0.00% 0 / 1 2
0.00%0.00%
0.00% 0 / 2
 suite($files)
0.00%0.00%
0.00% 0 / 1 6
0.00%0.00%
0.00% 0 / 8
 printMessage($message)
100.00%100.00%
100.00% 1 / 1 1
100.00%100.00%
100.00% 1 / 1


       1                 : <?php                                                                                  
       2                 : /**                                                                                    
       3                 :  * Dictionaries of Old French and Latin                                                
       4                 :  *                                                                                     
       5                 :  * PHP version 5                                                                       
       6                 :  *                                                                                     
       7                 :  * @category   DicFro                                                                  
       8                 :  * @package    Tests                                                                   
       9                 :  * @author     Michel Corne <mcorne@yahoo.com>                                         
      10                 :  * @copyright  2010 Michel Corne                                                       
      11                 :  * @license    http://www.opensource.org/licenses/bsd-license.php The BSD License      
      12                 :  * @version    SVN: $Id$                                                               
      13                 :  */                                                                                    
      14                 :                                                                                        
      15                 : define('APPLICATION_DIR', dirname(__FILE__) . '/../application/');                     
      16                 : is_dir(APPLICATION_DIR) or die('Error: invalid application directory!');               
      17                 :                                                                                        
      18                 : define('APPLICATION_TEST_DIR', dirname(__FILE__) . '/application/');                   
      19                 : is_dir(APPLICATION_TEST_DIR) or die('Error: invalid application test directory!');     
      20                 :                                                                                        
      21                 : defined('PHPUnit_MAIN_METHOD') or define('PHPUnit_MAIN_METHOD', 'AllTests::main');     
      22                 :                                                                                        
      23                 : // require_once 'PHPUnit/Framework.php';                                               
      24                 : require_once 'PHPUnit/TextUI/TestRunner.php';                                          
      25                 : require_once 'Filter.php';                                                             
      26                 : require_once 'Test.php';                                                               
      27                 :                                                                                        
      28                 : set_include_path(APPLICATION_DIR . PATH_SEPARATOR . get_include_path());               
      29                 :                                                                                        
      30                 : // removes test directory for test code coverage report                                
      31                 : // PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__), array('.php')); FIX!!!!
      32                 :                                                                                        
      33                 : date_default_timezone_set('UTC');                                                      
      34                 :                                                                                        
      35                 : /**                                                                                    
      36                 :  * Test suite                                                                          
      37                 :  *                                                                                     
      38                 :  * @category   DicFro                                                                  
      39                 :  * @package    Tests                                                                   
      40                 :  * @author     Michel Corne <mcorne@yahoo.com>                                         
      41                 :  * @copyright  2010 Michel Corne                                                       
      42                 :  * @license    http://www.opensource.org/licenses/bsd-license.php The BSD License      
      43                 :  */                                                                                    
      44                 :                                                                                        
      45                 : class AllTests                                                                         
      46                 : {                                                                                      
      47                 :     /**                                                                                
      48                 :      * Runs the tests                                                                  
      49                 :      *                                                                                 
      50                 :      * @param  array $files the files to test                                          
      51                 :      * @return void                                                                    
      52                 :      */                                                                                
      53                 :     public static function main($files)                                                
      54                 :     {                                                                                  
      55               0 :         PHPUnit_TextUI_TestRunner::run(self::suite());                                 
      56               0 :     }                                                                                  
      57                 :                                                                                        
      58                 :     /**                                                                                
      59                 :      * Runs the tests                                                                  
      60                 :      *                                                                                 
      61                 :      * @param  array $files the files to test                                          
      62                 :      * @return object  the test suite object                                           
      63                 :      */                                                                                
      64                 :     public static function suite($files)                                               
      65                 :     {                                                                                  
      66               0 :         $suite = new PHPUnit_Framework_TestSuite('DicFro Tests');                      
      67                 :                                                                                        
      68               0 :         if ($files = Filter::listTestFiles(APPLICATION_DIR, APPLICATION_TEST_DIR)) {   
      69               0 :             $message = "Files to test ...\n" . implode("\n", $files);                  
      70               0 :         } else {                                                                       
      71               0 :             $message = "No files to test!";                                            
      72                 :         }                                                                              
      73               0 :         echo "$message\n\n";                                                           
      74                 :                                                                                        
      75               0 :         $suite->addTestFiles($files);                                                  
      76                 :                                                                                        
      77               0 :         return $suite;                                                                 
      78                 :     }                                                                                  
      79                 :                                                                                        
      80                 :     /**                                                                                
      81                 :      * Formats a test title to display                                                 
      82                 :      *                                                                                 
      83                 :      * @param  string $message the message                                             
      84                 :      * @return string  the formatted message                                           
      85                 :      */                                                                                
      86                 :     public static function printMessage($message)                                      
      87                 :     {                                                                                  
      88             106 :         return strtoupper("*** error: $message ***");                                  
      89                 :     }                                                                                  
      90                 : }                                                                                      
      91                 :                                                                                        
      92                 : PHPUnit_MAIN_METHOD == 'AllTests::main' and AllTests::main($files);                    

Generated by PHP_CodeCoverage 1.0.0 using PHP 5.3.3 and PHPUnit 3.5.0 at Wed Jan 4 16:32:24 UTC 2012.