• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SimpleErrorQueue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SimpleErrorQueue的典型用法代码示例。如果您正苦于以下问题:PHP SimpleErrorQueue类的具体用法?PHP SimpleErrorQueue怎么用?PHP SimpleErrorQueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SimpleErrorQueue类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testExpectationMatchCancelsIncomingError

 public function testExpectationMatchCancelsIncomingError()
 {
     $test = new MockSimpleTestCase();
     $test->expectOnce('assert', array(new IdenticalExpectation(new AnythingExpectation()), 'B', 'a message'));
     $test->setReturnValue('assert', true);
     $test->expectNever('error');
     $queue = new SimpleErrorQueue();
     $queue->setTestCase($test);
     $queue->expectError(new AnythingExpectation(), 'a message');
     $queue->add(1024, 'B', 'b.php', 100);
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:11,代码来源:errors_test.php


示例2: testTrappedErrorPLacedInQueue

 function testTrappedErrorPLacedInQueue() {
     $queue = &SimpleErrorQueue::instance();
     $this->assertFalse($queue->extract());
     trigger_error('Ouch!');
     list($severity, $message, $file, $line, $globals) = $queue->extract();
     $this->assertEqual($message, 'Ouch!');
     $this->assertEqual($file, __FILE__);
     $this->assertFalse($queue->extract());
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:errors_test.php


示例3: invoke

 function invoke($method)
 {
     set_error_handler('simpleTestErrorHandler');
     parent::invoke($method);
     $queue =& SimpleErrorQueue::instance();
     while (list($severity, $message, $file, $line, $globals) = $queue->extract()) {
         $test_case =& $this->getTestCase();
         $test_case->error($severity, $message, $file, $line, $globals);
     }
     restore_error_handler();
 }
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:11,代码来源:runner.php


示例4: simpleTestErrorHandler

function simpleTestErrorHandler($severity, $message, $filename, $line, $super_globals)
{
    if ($severity = $severity & error_reporting()) {
        restore_error_handler();
        if (ini_get('log_errors')) {
            $label = SimpleErrorQueue::getSeverityAsString($severity);
            error_log("{$label}: {$message} in {$filename} on line {$line}");
        }
        $queue =& SimpleErrorQueue::instance();
        $queue->add($severity, $message, $filename, $line, $super_globals);
        set_error_handler('simpleTestErrorHandler');
    }
}
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:13,代码来源:errors.php


示例5: invoke

 /**
  *    Invokes a test method and dispatches any
  *    untrapped errors. Called back from
  *    the visiting runner.
  *    @param string $method    Test method to call.
  *    @access public
  */
 function invoke($method)
 {
     $context =& SimpleTest::getContext();
     $queue =& $context->get('SimpleErrorQueue');
     $queue->setTestCase($this->GetTestCase());
     set_error_handler('SimpleTestErrorHandler');
     parent::invoke($method);
     while (list($severity, $message, $file, $line) = $queue->extract()) {
         $severity = SimpleErrorQueue::getSeverityAsString($severity);
         $test =& $this->getTestCase();
         $test->error($severity, $message, $file, $line);
     }
     restore_error_handler();
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:21,代码来源:errors.php


示例6: swallowErrors

 function swallowErrors()
 {
     $queue =& SimpleErrorQueue::instance();
     $queue->clear();
 }
开发者ID:BackupTheBerlios,项目名称:phpbase-svn,代码行数:5,代码来源:simple_test.php


示例7: assertErrorPattern

 /**
  *    Confirms that an error has occoured and
  *    that the error text matches a Perl regular
  *    expression.
  *    @param string $expected   Perl regular expresion to
  *                              match against.
  *    @param string $message    Message to display.
  *    @return boolean           True on pass
  *    @access public
  */
 function assertErrorPattern($pattern, $message = "%s")
 {
     $queue =& SimpleErrorQueue::instance();
     if ($queue->isEmpty()) {
         $this->fail(sprintf($message, "Expected error not found"));
         return;
     }
     list($severity, $content, $file, $line, $globals) = $queue->extract();
     $severity = SimpleErrorQueue::getSeverityAsString($severity);
     return $this->assertTrue((bool) preg_match($pattern, $content), "Expected pattern match [{$pattern}] in PHP error [{$content}] severity [{$severity}] in [{$file}] line [{$line}]");
 }
开发者ID:justinlyon,项目名称:scc,代码行数:21,代码来源:unit_tester.php


示例8: assertError

 /**
  *    Confirms that an error has occoured and
  *    optionally that the error text matches exactly.
  *    @param string $expected   Expected error text or
  *                              false for no check.
  *    @param string $message    Message to display.
  *    @return boolean           True on pass
  *    @access public
  */
 function assertError($expected = false, $message = "%s")
 {
     $queue =& SimpleErrorQueue::instance();
     if ($queue->isEmpty()) {
         $this->fail(sprintf($message, "Expected error not found"));
         return;
     }
     list($severity, $content, $file, $line, $globals) = $queue->extract();
     $severity = SimpleErrorQueue::getSeverityAsString($severity);
     if (!$expected) {
         return $this->pass("Captured a PHP error of [{$content}] severity [{$severity}] in [{$file}] line [{$line}] -> %s");
     }
     $expected = $this->_coerceToExpectation($expected);
     return $this->assert($expected, $content, "Expected PHP error [{$content}] severity [{$severity}] in [{$file}] line [{$line}] -> %s");
 }
开发者ID:TomMaher,项目名称:umambo,代码行数:24,代码来源:unit_tester.php


示例9: SimpleTestErrorHandler

/**
 *    Error handler that simply stashes any errors into the global
 *    error queue. Simulates the existing behaviour with respect to
 *    logging errors, but this feature may be removed in future.
 *
 *    @param $severity        PHP error code.
 *    @param $message         Text of error.
 *    @param $filename        File error occoured in.
 *    @param $line            Line number of error.
 *    @param $super_globals   Hash of PHP super global arrays.
 *    @static
 */
function SimpleTestErrorHandler($severity, $message, $filename = null, $line = null, $super_globals = null, $mask = null)
{
    $severity = $severity & error_reporting();
    if ($severity) {
        restore_error_handler();
        if (ini_get('log_errors')) {
            $label = SimpleErrorQueue::getSeverityAsString($severity);
            error_log("{$label}: {$message} in {$filename} on line {$line}");
        }
        $context =& SimpleTest::getContext();
        $queue =& $context->get('SimpleErrorQueue');
        $queue->add($severity, $message, $filename, $line);
        set_error_handler('SimpleTestErrorHandler');
    }
    return true;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:28,代码来源:errors.php


示例10: simpleTestErrorHandler

 /**
  *    Error handler that simply stashes any
  *    errors into the global error queue.
  *    @param $severity        PHP error code.
  *    @param $message         Text of error.
  *    @param $filename        File error occoured in.
  *    @param $line            Line number of error.
  *    @param $super_globals   Hash of PHP super global arrays.
  *    @static
  *    @access public
  */
 function simpleTestErrorHandler($severity, $message, $filename, $line, $super_globals) {
     restore_error_handler();
     if ($severity = $severity & error_reporting()) {
         $queue = &SimpleErrorQueue::instance();
         $queue->add($severity, $message, $filename, $line, $super_globals);
     }
     set_error_handler('simpleTestErrorHandler');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:errors.php


示例11: SimpleTestErrorHandler

/**
 *    Error handler that simply stashes any errors into the global
 *    error queue. Simulates the existing behaviour with respect to
 *    logging errors, but this feature may be removed in future.
 * @param $severity        PHP error code.
 * @param $message         Text of error.
 * @param $filename        File error occoured in.
 * @param $line            Line number of error.
 * @param $super_globals   Hash of PHP super global arrays.
 */
function SimpleTestErrorHandler($severity, $message, $filename = null, $line = null, $super_globals = null, $mask = null)
{
    $severity = $severity & error_reporting();
    if ($severity) {
        restore_error_handler();
        if (IsNotCausedBySimpleTest($message) && IsNotTimeZoneNag($message)) {
            if (ini_get('log_errors')) {
                $label = SimpleErrorQueue::getSeverityAsString($severity);
                if (openlog('cdash', LOG_PID, LOG_USER)) {
                    syslog(LOG_ERR, "{$label}: {$message} in {$filename} on line {$line}");
                    closelog();
                }
            }
            $queue = SimpleTest::getContext()->get('SimpleErrorQueue');
            $queue->add($severity, $message, $filename, $line);
        }
        set_error_handler('SimpleTestErrorHandler');
    }
    return true;
}
开发者ID:kitware,项目名称:cdash,代码行数:30,代码来源:errors.php


示例12: testExpectationMissTriggersError

 function testExpectationMissTriggersError()
 {
     $test = new MockSimpleTestCase();
     $test->expectOnce('assert', array(new MockSimpleExpectation(), 'B', 'a message'));
     $test->setReturnValue('assert', false);
     $test->expectOnce('error');
     $queue = new SimpleErrorQueue();
     $queue->setTestCase($test);
     $queue->expectError(new MockSimpleExpectation(), 'a message');
     $queue->add(1024, 'B', 'b.php', 100);
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:11,代码来源:errors_test.php


示例13: SimpleTestErrorHandler

/**
 * Error handler that simply stashes any errors into the global error queue.
 * Simulates the existing behaviour with respect to logging errors,
 * but this feature may be removed in future.
 *
 * @param $severity        PHP error code.
 * @param $message         Text of error.
 * @param $filename        File error occoured in.
 * @param $line            Line number of error.
 * @param $super_globals   Hash of PHP super global arrays.
 */
function SimpleTestErrorHandler($severity, $message, $filename = null, $line = null, $super_globals = null, $mask = null)
{
    $severity = $severity & error_reporting();
    if ($severity) {
        restore_error_handler();
        // disabled filtering of errors caused by SimpleTest itself. too many things hidden for debugging. -- jakoch
        if (IsNotTimeZoneNag($message)) {
            if (ini_get('log_errors')) {
                $label = SimpleErrorQueue::getSeverityAsString($severity);
                error_log("{$label}: {$message} in {$filename} on line {$line}");
            }
            $queue = SimpleTest::getContext()->get('SimpleErrorQueue');
            $queue->add($severity, $message, $filename, $line);
        }
        set_error_handler('SimpleTestErrorHandler');
    }
    return true;
}
开发者ID:guicara,项目名称:simpletest,代码行数:29,代码来源:errors.php



注:本文中的SimpleErrorQueue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SimpleExpectation类代码示例发布时间:2022-05-23
下一篇:
PHP SimpleEncoding类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap