Пример #1
0
 /**
  * Registers available options.
  */
 public static function registerOptions()
 {
     /**
      * Protect against multiple calls.
      */
     if (!is_null(self::$option_flags_by_name)) {
         return;
     }
     /**
      * Initialize options flag array.
      */
     self::$option_flags_by_name = array();
     /**
      * The possible base options.
      */
     $options = array('DONT_ACCEPT_TRUE_FOR_1', 'DONT_ACCEPT_BLANKLINE', 'NORMALIZE_WHITESPACE', 'ELLIPSIS', 'SKIP', 'IGNORE_EXCEPTION_DETAIL', 'REPORT_UDIFF', 'REPORT_NDIFF', 'REPORT_CDIFF', 'REPORT_ONLY_FIRST_FAILURE');
     /**
      * Define a global namespaced constant for each option and add it
      * to the static named options array.
      */
     foreach ($options as $i => $option) {
         $namespaced = 'DOCTEST_' . $option;
         define($namespaced, 1 << $i);
         self::$option_flags_by_name[$option] = constant($namespaced);
     }
     /**
      * Create comparison flags combination.
      */
     $comp_flags = DOCTEST_DONT_ACCEPT_TRUE_FOR_1 | DOCTEST_DONT_ACCEPT_BLANKLINE | DOCTEST_NORMALIZE_WHITESPACE | DOCTEST_ELLIPSIS | DOCTEST_SKIP | DOCTEST_IGNORE_EXCEPTION_DETAIL;
     define('DOCTEST_COMPARISON_FLAGS', $comp_flags);
     /**
      * Create reporting flags combination.
      */
     $rep_flags = DOCTEST_REPORT_UDIFF | DOCTEST_REPORT_CDIFF | DOCTEST_REPORT_NDIFF | DOCTEST_REPORT_ONLY_FIRST_FAILURE;
     define('DOCTEST_REPORTING_FLAGS', $rep_flags);
 }