當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestHandler::hasNoticeRecords方法代碼示例

本文整理匯總了PHP中Monolog\Handler\TestHandler::hasNoticeRecords方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestHandler::hasNoticeRecords方法的具體用法?PHP TestHandler::hasNoticeRecords怎麽用?PHP TestHandler::hasNoticeRecords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Monolog\Handler\TestHandler的用法示例。


在下文中一共展示了TestHandler::hasNoticeRecords方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testHandleProcessOnlyNeededLevels

 /**
  * @covers Monolog\Handler\FilterHandler::handle
  * @covers Monolog\Handler\FilterHandler::setAcceptedLevels
  * @covers Monolog\Handler\FilterHandler::isHandling
  */
 public function testHandleProcessOnlyNeededLevels()
 {
     $test = new TestHandler();
     $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE);
     $handler->handle($this->getRecord(Logger::DEBUG));
     $this->assertFalse($test->hasDebugRecords());
     $handler->handle($this->getRecord(Logger::INFO));
     $this->assertTrue($test->hasInfoRecords());
     $handler->handle($this->getRecord(Logger::NOTICE));
     $this->assertTrue($test->hasNoticeRecords());
     $handler->handle($this->getRecord(Logger::WARNING));
     $this->assertFalse($test->hasWarningRecords());
     $handler->handle($this->getRecord(Logger::ERROR));
     $this->assertFalse($test->hasErrorRecords());
     $handler->handle($this->getRecord(Logger::CRITICAL));
     $this->assertFalse($test->hasCriticalRecords());
     $handler->handle($this->getRecord(Logger::ALERT));
     $this->assertFalse($test->hasAlertRecords());
     $handler->handle($this->getRecord(Logger::EMERGENCY));
     $this->assertFalse($test->hasEmergencyRecords());
     $test = new TestHandler();
     $handler = new FilterHandler($test, array(Logger::INFO, Logger::ERROR));
     $handler->handle($this->getRecord(Logger::DEBUG));
     $this->assertFalse($test->hasDebugRecords());
     $handler->handle($this->getRecord(Logger::INFO));
     $this->assertTrue($test->hasInfoRecords());
     $handler->handle($this->getRecord(Logger::NOTICE));
     $this->assertFalse($test->hasNoticeRecords());
     $handler->handle($this->getRecord(Logger::ERROR));
     $this->assertTrue($test->hasErrorRecords());
     $handler->handle($this->getRecord(Logger::CRITICAL));
     $this->assertFalse($test->hasCriticalRecords());
 }
開發者ID:no-chris,項目名稱:connector,代碼行數:38,代碼來源:FilterHandlerTest.php

示例2: testNotice

 public function testNotice()
 {
     $context = array("foo" => "bar");
     Simple::notice("hello", $context);
     $this->assertTrue($this->handler->hasNoticeRecords());
     foreach ($this->handler->getRecords() as $record) {
         $this->assertEquals("hello", $record['message']);
         $this->assertEquals("NOTICE", $record['level_name']);
         $this->assertEquals($context, $record['context']);
     }
 }
開發者ID:centraldesktop,項目名稱:static-logger,代碼行數:11,代碼來源:SimpleTest.php

示例3: testNoticeExceptionErrorLog

 public function testNoticeExceptionErrorLog()
 {
     $this->assertFalse($this->monologHandler->hasNoticeRecords());
     $this->logHandler->handle(new \ErrorException('test exception', 0, E_NOTICE));
     $this->assertTrue($this->monologHandler->hasNoticeRecords());
 }
開發者ID:phprest,項目名稱:phprest,代碼行數:6,代碼來源:LogTest.php


注:本文中的Monolog\Handler\TestHandler::hasNoticeRecords方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。