Skip to content

Commit 4d391f2

Browse files
committed
remove console test on listener as moved to laminas-cli
1 parent 4eee6fa commit 4d391f2

File tree

1 file changed

+1
-35
lines changed

1 file changed

+1
-35
lines changed

spec/Listener/MvcSpec.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
use ErrorHeroModule\Listener\Mvc;
99
use Exception;
1010
use Kahlan\Plugin\Double;
11-
use Kahlan\Plugin\Quit;
12-
use Kahlan\QuitException;
13-
use Laminas\Console\Console;
14-
use Laminas\Console\Request as ConsoleRequest;
1511
use Laminas\Db\Adapter\Adapter;
1612
use Laminas\Db\Adapter\AdapterInterface;
1713
use Laminas\EventManager\EventManagerInterface;
@@ -166,38 +162,8 @@
166162

167163
});
168164

169-
it('call logging->handleErrorException() with default console error message if $e->getParam("exception") and display_errors = 0', function (): void {
165+
it('call logging->handleErrorException() with default view error if $e->getParam("exception") and display_errors = 0', function (): void {
170166

171-
Console::overrideIsConsole(true);
172-
173-
Quit::disable();
174-
$exception = new Exception('message');
175-
176-
$mvcEvent = Double::instance(['extends' => MvcEvent::class, 'methods' => '__construct']);
177-
allow($mvcEvent)->toReceive('getParam')->andReturn($exception);
178-
$request = new ConsoleRequest();
179-
allow($mvcEvent)->toReceive('getRequest')->andReturn($request);
180-
allow($this->logging)->toReceive('handleErrorException')->with($exception, $request);
181-
182-
$listener = new Mvc(
183-
$this->config,
184-
$this->logging,
185-
$this->renderer
186-
);
187-
188-
\ob_start();
189-
$closure = function () use ($listener, $mvcEvent): void {
190-
$listener->exceptionError($mvcEvent);
191-
};
192-
expect($closure)->toThrow(new QuitException('Exit statement occurred', -1));
193-
$content = \ob_get_clean();
194-
195-
expect($content)->toContain('|We have encountered a problem');
196-
});
197-
198-
it('call logging->handleErrorException() with default view error if $e->getParam("exception") and display_errors = 0 and not a console', function (): void {
199-
200-
Console::overrideIsConsole(false);
201167
$exception = new Exception('message');
202168

203169
$mvcEvent = Double::instance(['extends' => MvcEvent::class, 'methods' => '__construct']);

0 commit comments

Comments
 (0)