PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/dom - domexception.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 25 42 59.5 %
Date: 2014-09-27 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 7                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2014 The PHP Group                                |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Christian Stocker <chregu@php.net>                          |
      16             :    |          Rob Richards <rrichards@php.net>                            |
      17             :    +----------------------------------------------------------------------+
      18             : */
      19             : 
      20             : /* $Id$ */
      21             : 
      22             : #ifdef HAVE_CONFIG_H
      23             : #include "config.h"
      24             : #endif
      25             : 
      26             : #include "php.h"
      27             : #if HAVE_LIBXML && HAVE_DOM
      28             : #include "php_dom.h"
      29             : 
      30             : /*
      31             : * class DOMException 
      32             : *
      33             : * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-17189187
      34             : * Since: 
      35             : */
      36             : 
      37             : extern zend_class_entry *dom_domexception_class_entry;
      38             : 
      39             : const zend_function_entry php_dom_domexception_class_functions[] = {
      40             :         PHP_FE_END
      41             : };
      42             : 
      43          55 : void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) /* {{{ */
      44             : {
      45          55 :         if (strict_error == 1) {
      46          46 :                 zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
      47             :         } else {
      48           9 :                 php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC);
      49             :         }
      50          55 : }
      51             : /* }}} */
      52             : 
      53             : /* {{{ php_dom_throw_error */
      54          55 : void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
      55             : {
      56             :         char *error_message;
      57             : 
      58          55 :         switch (error_code)
      59             :         {
      60             :                 case INDEX_SIZE_ERR:
      61           5 :                         error_message = "Index Size Error";
      62           5 :                         break;
      63             :                 case DOMSTRING_SIZE_ERR:
      64           0 :                         error_message = "DOM String Size Error";
      65           0 :                         break;
      66             :                 case HIERARCHY_REQUEST_ERR:
      67           2 :                         error_message = "Hierarchy Request Error";
      68           2 :                         break;
      69             :                 case WRONG_DOCUMENT_ERR:
      70           2 :                         error_message = "Wrong Document Error";
      71           2 :                         break;
      72             :                 case INVALID_CHARACTER_ERR:
      73          14 :                         error_message = "Invalid Character Error";
      74          14 :                         break;
      75             :                 case NO_DATA_ALLOWED_ERR:
      76           0 :                         error_message = "No Data Allowed Error";
      77           0 :                         break;
      78             :                 case NO_MODIFICATION_ALLOWED_ERR:
      79           1 :                         error_message = "No Modification Allowed Error";
      80           1 :                         break;
      81             :                 case NOT_FOUND_ERR:
      82           5 :                         error_message = "Not Found Error";
      83           5 :                         break;
      84             :                 case NOT_SUPPORTED_ERR:
      85           0 :                         error_message = "Not Supported Error";
      86           0 :                         break;
      87             :                 case INUSE_ATTRIBUTE_ERR:
      88           0 :                         error_message = "Inuse Attribute Error";
      89           0 :                         break;
      90             :                 case INVALID_STATE_ERR:
      91           8 :                         error_message = "Invalid State Error";
      92           8 :                         break;
      93             :                 case SYNTAX_ERR:
      94           0 :                         error_message = "Syntax Error";
      95           0 :                         break;
      96             :                 case INVALID_MODIFICATION_ERR:
      97           0 :                         error_message = "Invalid Modification Error";
      98           0 :                         break;
      99             :                 case NAMESPACE_ERR:
     100          18 :                         error_message = "Namespace Error";
     101          18 :                         break;
     102             :                 case INVALID_ACCESS_ERR:
     103           0 :                         error_message = "Invalid Access Error";
     104           0 :                         break;
     105             :                 case VALIDATION_ERR:
     106           0 :                         error_message = "Validation Error";
     107           0 :                         break;
     108             :                 default:
     109           0 :                         error_message = "Unhandled Error";
     110             :         }
     111             : 
     112          55 :         php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC);
     113          55 : }
     114             : /* }}} end php_dom_throw_error */
     115             : 
     116             : #endif /* HAVE_LIBXML && HAVE_DOM */
     117             : 
     118             : /*
     119             :  * Local variables:
     120             :  * tab-width: 4
     121             :  * c-basic-offset: 4
     122             :  * End:
     123             :  * vim600: noet sw=4 ts=4 fdm=marker
     124             :  * vim<600: noet sw=4 ts=4
     125             :  */

Generated by: LCOV version 1.10

Generated at Sat, 27 Sep 2014 16:43:07 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.