Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpcbf service-front/app/features #2405

Merged
merged 9 commits into from
Nov 14, 2023
7 changes: 5 additions & 2 deletions service-front/app/config/autoload/console.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

declare(strict_types=1);

use Common\Command\TranslationUpdateCommand;
use Common\Command\TranslationUpdateCommandFactory;

return [
'dependencies' => [
'invokables' => [],
'factories' => [
Common\Command\TranslationUpdateCommand::class => Common\Command\TranslationUpdateCommandFactory::class,
TranslationUpdateCommand::class => TranslationUpdateCommandFactory::class,
],
],
'console' => [
'commands' => [
Common\Command\TranslationUpdateCommand::class,
TranslationUpdateCommand::class,
],
],
];
13 changes: 6 additions & 7 deletions service-front/app/config/autoload/development.local.php.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Development-only configuration.
*
Expand All @@ -19,16 +20,14 @@ return [
'cookie_name' => 'session', // The normally configured "__Host-session" name does not work for dev due to SSL
],
'dependencies' => [
'invokables' => [
],
'invokables' => [],
'factories' => [
ErrorResponseGenerator::class => Container\WhoopsErrorResponseGeneratorFactory::class,
'Mezzio\Whoops' => Container\WhoopsFactory::class,
'Mezzio\WhoopsPageHandler' => Container\WhoopsPageHandlerFactory::class,
ErrorResponseGenerator::class => Container\WhoopsErrorResponseGeneratorFactory::class,
'Mezzio\Whoops' => Container\WhoopsFactory::class,
'Mezzio\WhoopsPageHandler' => Container\WhoopsPageHandlerFactory::class,
],
],

'whoops' => [
'whoops' => [
'json_exceptions' => [
'display' => true,
'show_trace' => true,
Expand Down
3 changes: 2 additions & 1 deletion service-front/app/config/development.config.php.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* File required to allow enablement of development mode.
*
Expand All @@ -25,6 +26,6 @@ declare(strict_types=1);
use Laminas\ConfigAggregator\ConfigAggregator;

return [
'debug' => true,
'debug' => true,
ConfigAggregator::ENABLE_CACHE => false,
];
7 changes: 5 additions & 2 deletions service-front/app/features/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

declare(strict_types=1);

use Mezzio\Application;
use Mezzio\MiddlewareFactory;

/** @var \Mezzio\Application $app */
$app = $container->get(\Mezzio\Application::class);
$factory = $container->get(\Mezzio\MiddlewareFactory::class);
$app = $container->get(Application::class);
$factory = $container->get(MiddlewareFactory::class);

// Execute programmatic/declarative middleware pipeline and routing
// configuration statements
Expand Down
3 changes: 2 additions & 1 deletion service-front/app/features/bootstrap/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregator\PhpFileProvider;
use Mezzio\Authentication\Session\ConfigProvider;

$aggregator = new ConfigAggregator([
Mezzio\Authentication\Session\ConfigProvider::class,
ConfigProvider::class,
Mezzio\Router\FastRouteRouter\ConfigProvider::class,
Laminas\HttpHandlerRunner\ConfigProvider::class,
Laminas\Cache\ConfigProvider::class,
Expand Down
4 changes: 2 additions & 2 deletions service-front/app/features/bootstrap/container.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

use Elie\PHPDI\Config\Config;
use Elie\PHPDI\Config\ContainerFactory;

$config = require __DIR__ . '/config.php';
$config = require __DIR__ . '/config.php';

$factory = new ContainerFactory();

Expand Down
5 changes: 3 additions & 2 deletions service-front/app/features/context/ActorContextTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ trait ActorContextTrait
/**
* @BeforeSuite
*/
public static function setupEnv() {
public static function setupEnv()
{
// set the side of the application we're using
putenv('CONTEXT=actor');

Expand All @@ -27,4 +28,4 @@ public static function cleanupEnv()
putenv('AWS_ACCESS_KEY_ID=');
putenv('AWS_SECRET_ACCESS_KEY=');
}
}
}
14 changes: 4 additions & 10 deletions service-front/app/features/context/BaseUiContextTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* Trait BaseUiContextTrait
*
* A trait that allows a utilising context to access the ui and mink functionality loaded in the BaseUiContext
*
* @package BehatTest\Context
*/
trait BaseUiContextTrait
{
Expand All @@ -33,8 +31,8 @@ public function gatherContexts(BeforeScenarioScope $scope): void
{
$environment = $scope->getEnvironment();

$this->base = $environment->getContext(BaseUiContext::class);
$this->ui = $this->base->ui; // MinkContext gathered in BaseUiContext
$this->base = $environment->getContext(BaseUiContext::class);
$this->ui = $this->base->ui; // MinkContext gathered in BaseUiContext
$this->apiFixtures = $this->base->apiFixtures;
$this->awsFixtures = $this->base->awsFixtures;
}
Expand All @@ -55,20 +53,16 @@ public function assertResponseHeader($name, $value): void
* Verifies a Javascript accordion element is open
*
* @param string $searchStr
*
* @return bool
*/
public function elementIsOpen(string $searchStr): bool
{
$page = $this->ui->getSession()->getPage();
$element = $page->find('css', $searchStr);
$page = $this->ui->getSession()->getPage();
$element = $page->find('css', $searchStr);
$elementHtml = $element->getOuterHtml();
return str_contains($elementHtml, ' open');
}

/**
* @return SharedState
*/
public function sharedState(): SharedState
{
return SharedState::getInstance();
Expand Down
7 changes: 3 additions & 4 deletions service-front/app/features/context/ContextUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ class ContextUtilities
* @param string $body the body of the request
* @param string $reason this hijacks the reason phrase for debug purposes so that we can input the api call that
* the response is for. @see LpaContext::iCanSeeThatNoOrganisationsHaveAccessToMyLPA()
*
* @return ResponseInterface
*/
public static function newResponse(int $status, string $body, string $reason = ''): ResponseInterface
{
$bt = debug_backtrace();
$bt = debug_backtrace();
$caller = array_shift($bt);
$file = $caller['file'];
$line = $caller['line'];
$file = $caller['file'];
$line = $caller['line'];

return new Response(
status: $status,
Expand Down
Loading
Loading