@froschdesign
Just wanna mention, it worked before in zend and php7.4. I did not change the code and related test. just is updated to laminas and php8.
this comes from Module
public function onBootstrap(MvcEvent $e): void
{
$eventManager = $e->getApplication()->getEventManager();
$eventManager->attach(
MvcEvent::EVENT_DISPATCH_ERROR,
[$this, 'handleDispatchError'],
100
);
$eventManager->attach(
MvcEvent::EVENT_RENDER_ERROR,
[$this, 'handleRenderError'],
100
);
$serviceManager = $e->getApplication()->getServiceManager();
/* @var $bypassAuth BypassAuth */
$bypassAuth = $serviceManager->get(BypassAuth::class); // test failure pointed here
$bypassAuth->attach($eventManager);
}
global.php
return [
// Session
'session_config' => [
'name' => 'ubs_solo',
'use_cookies' => true,
'cookie_path' => '/ubs-solo',
'cookie_secure' => false,
'cookie_httponly' => true,
//timeouts
'cache_expire' => 840,
'cookie_lifetime' => 50400,
'gc_maxlifetime' => 50400 * 1000,
'remember_me_seconds' => 50400,
],
'session_storage' => [
'type' => Session\Storage\SessionArrayStorage::class,
],
- I have got same test failures in all 7 tests.
this is one of those test
public function testIndexAction(): void
{
$this->dispatch('/page-api/product-outstanding', Request::METHOD_GET); // test failure mentioned here)
$content = $this->getResponse()->getContent();
static::assertNotEmpty($content);
$this->assertResponseStatusCode(200);
$this->assertControllerName(OutstandingControllerFactory::SERVICE);
$this->assertActionName('index');
$responseObject = json_decode($content, true);
static::assertEquals('OK', $responseObject['state']);
static::assertNotEmpty($responseObject['data']);
static::assertArrayHasKey('groups', $responseObject['data']);
static::assertArrayHasKey('products', $responseObject['data']['groups']);
static::assertArrayHasKey('count', $responseObject['data']);
static::assertArrayHasKey('filters', $responseObject['data']);
static::assertArrayHasKey('totalCount', $responseObject['data']);
static::assertArrayHasKey('structure', $responseObject['data']['filters']);
static::assertArrayHasKey('underlying', $responseObject['data']['filters']);
static::assertArrayHasKey('issuer', $responseObject['data']['filters']);
static::assertArrayHasKey('cusip', $responseObject['data']['filters']);
static::assertArrayHasKey('tenor', $responseObject['data']['filters']);
static::assertArrayHasKey('maturityDate', $responseObject['data']['filters']);
static::assertArrayHasKey('platform', $responseObject['data']['filters']);
static::assertArrayHasKey('accountTypeEligibility', $responseObject['data']['filters']);
static::assertArrayHasKey('tradeDate', $responseObject['data']['filters']);
}