Пример #1
0
 private function createHandler($options = array(), $notifyOnWarning = true)
 {
     EventHandler::reset();
     $this->connection = new TestConnection();
     $this->handler = EventHandler::start(1, $notifyOnWarning, $options);
     $this->handler->getClient()->setConnection($this->connection);
 }
Пример #2
0
 /**
  * @dataProvider testMethodsProvider
  */
 public function testMethods($expectedLevel, $methodName)
 {
     EventHandler::reset();
     $connection = new TestConnection();
     $options = array('errorReportingLevel' => $expectedLevel);
     $handler = EventHandler::start(1, true, $options);
     $handler->getClient()->setConnection($connection);
     $this->trigger->{$methodName}();
     $this->assertEquals(1, $connection->sendCalls);
 }