Skip to content

Commit

Permalink
Fix HandlerLoaderTest::testHandlerForProcessor
Browse files Browse the repository at this point in the history
ProcessableHandlerInterface::pushProcessor expects the $callback argument to be a callable. Fix the following error:

PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

....................E...........................WWWWWWWWWWWWWWWWW 65 / 97 ( 67%)
WWWWW....WWWWWWWWW..............                                  97 / 97 (100%)

Time: 101 ms, Memory: 8.00MB

There was 1 error:

1) Cascade\Tests\Config\Loader\ClassLoader\HandlerLoaderTest::testHandlerForProcessor
TypeError: Argument 1 passed to Mock_TestHandler_f2eedf4c::pushProcessor() must be callable, string given, called in /home/danilo/monolog-cascade/src/Config/Loader/ClassLoader/HandlerLoader.php on line 187

/home/danilo/monolog-cascade/src/Config/Loader/ClassLoader/HandlerLoader.php:187
/home/danilo/monolog-cascade/tests/Config/Loader/ClassLoader/HandlerLoaderTest.php:263
  • Loading branch information
hertz1 committed Dec 24, 2020
1 parent 846900f commit c392690
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/Config/Loader/ClassLoader/HandlerLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,15 @@ public function testHandlerForProcessor()
{
$options = array();

$mockProcessor1 = '123';
$mockProcessor2 = '456';
$mockProcessor1 = function($record) {
$record['extra']['dummy'] = 'Hello world 1!';
return $record;
};
$mockProcessor2 = function($record) {
$record['extra']['dummy'] = 'Hello world 2!';
return $record;
};

$processorsArray = array($mockProcessor1, $mockProcessor2);

// Setup mock and expectations
Expand Down

0 comments on commit c392690

Please sign in to comment.