|
@@ 221-230 (lines=10) @@
|
| 218 |
|
$errorHandler->log($exception); |
| 219 |
|
} |
| 220 |
|
|
| 221 |
|
public function testLogString() |
| 222 |
|
{ |
| 223 |
|
$logger = $this->createMock(LoggerInterface::class); |
| 224 |
|
$logger->expects($this->once())->method('log')->with(LogLevel::WARNING, "Unable to log a string"); |
| 225 |
|
|
| 226 |
|
$errorHandler = new ErrorHandler(); |
| 227 |
|
$errorHandler->setLogger($logger); |
| 228 |
|
|
| 229 |
|
$errorHandler->log('foo'); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
public function testLogObject() |
| 233 |
|
{ |
|
@@ 232-241 (lines=10) @@
|
| 229 |
|
$errorHandler->log('foo'); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
public function testLogObject() |
| 233 |
|
{ |
| 234 |
|
$logger = $this->createMock(LoggerInterface::class); |
| 235 |
|
$logger->expects($this->once())->method('log')->with(LogLevel::WARNING, "Unable to log a stdClass object"); |
| 236 |
|
|
| 237 |
|
$errorHandler = new ErrorHandler(); |
| 238 |
|
$errorHandler->setLogger($logger); |
| 239 |
|
|
| 240 |
|
$errorHandler->log(new \stdClass()); |
| 241 |
|
} |
| 242 |
|
} |
| 243 |
|
|