SimpleTemplatingDriver.php
Current file: C:\DATA\Viktor\Diplomka\XSLT-Benchmarking/XSLTBenchmarking/TestsGenerator/Templating/SimpleTemplatingDriver.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
100.00% 1 / 1
100.00% 2 / 2 CRAP
100.00% 4 / 4
SimpleTemplatingDriver
100.00% 1 / 1
100.00% 2 / 2 3
100.00% 4 / 4
 __construct($tmpDirectory)
100.00% 1 / 1 1
100.00% 1 / 1
 generate($templatePath, $outputPath, array $settings = array()
100.00% 1 / 1 2
100.00% 3 / 3



       1                 : <?php                                                                                                          
       2                 :                                                                                                                
       3                 : /**                                                                                                            
       4                 :  * XSLT Benchmarking                                                                                           
       5                 :  * @link https://github.com/masicek/XSLT-Benchmarking                                                          
       6                 :  * @author Viktor Mašíček <viktor@masicek.net>                                                              
       7                 :  * @license "New" BSD License                                                                                  
       8                 :  */                                                                                                            
       9                 :                                                                                                                
      10                 : namespace XSLTBenchmarking\TestsGenerator;                                                                     
      11                 :                                                                                                                
      12                 : require_once LIBS . '/PhpPath/PhpPath.min.php';                                                                
      13                 : require_once __DIR__ . '/ITemplatingDriver.php';                                                               
      14                 : require_once ROOT . '/Exceptions.php';                                                                         
      15                 :                                                                                                                
      16                 :                                                                                                                
      17                 : use PhpPath\P;                                                                                                 
      18                 :                                                                                                                
      19                 : /**                                                                                                            
      20                 :  * Simple templating - only copy input file into output file.                                                  
      21                 :  *                                                                                                             
      22                 :  * @author Viktor Mašíček <viktor@masicek.net>                                                              
      23                 :  */                                                                                                            
      24                 : class SimpleTemplatingDriver implements ITemplatingDriver                                                      
      25                 : {                                                                                                              
      26                 :                                                                                                                
      27                 :                                                                                                                
      28                 :     /**                                                                                                        
      29                 :      * Object configuration                                                                                    
      30                 :      *                                                                                                         
      31                 :      * @param string $tmpDirectory The path of the temporary directory                                         
      32                 :      */                                                                                                        
      33                 :     public function __construct($tmpDirectory)                                                                 
      34                 :     {                                                                                                          
      35               3 :     }                                                                                                          
      36                 :                                                                                                                
      37                 :                                                                                                                
      38                 :     /**                                                                                                        
      39                 :      * Copy input file into output file                                                                        
      40                 :      *                                                                                                         
      41                 :      * @param string $templatePath Path of file to copy                                                        
      42                 :      * @param string $outputPath Path output file                                                              
      43                 :      * @param array $settings Settings are not use in this driver                                              
      44                 :      *                                                                                                         
      45                 :      * @throws \XSLTBenchmarking\GenerateTemplateException Problem with generating                             
      46                 :      * @return void                                                                                            
      47                 :      */                                                                                                        
      48                 :     public function generate($templatePath, $outputPath, array $settings = array())                            
      49                 :     {                                                                                                          
      50               2 :         P::cf($templatePath);                                                                                  
      51                 :                                                                                                                
      52               1 :         if (!copy($templatePath, $outputPath))                                                                 
      53                 :         {// @codeCoverageIgnoreStart                                                                           
      54                 :             throw new \XSLTBenchmarking\GenerateTemplateException('Cannot create file "' . $outputFile . '".');
      55                 :         }// @codeCoverageIgnoreEnd                                                                             
      56               1 :     }                                                                                                          
      57                 :                                                                                                                
      58                 :                                                                                                                
      59                 : }                                                                                                              


Generated by PHP_CodeCoverage @package_version@ using PHP 5.3.6 and PHPUnit @package_version@ at Tue Jun 26 15:06:55 CEST 2012.