Exemplo n.º 1
0
 /**
  * Helper method
  *
  * @param   var $expected
  * @param   util.log.LogCategory $cat
  * @param   function(util.log.LogCategory): void $func A function to be called with `$cat` as argument
  * @throws  unittest.AssertionFailedError
  */
 private function assertLogged($result, $cat, $func)
 {
     $app = $cat->addAppender($this->mockAppender());
     $func($cat);
     $this->assertEquals($result, $app->messages);
 }
Exemplo n.º 2
0
 public function getContext_returns_context_previously_set_with_setContext()
 {
     $cat = new LogCategory();
     $context = new NestedLogContext();
     $cat->setContext($context);
     $this->assertEquals($context, $cat->getContext());
 }