Skip to content

Commit

Permalink
TASK: Move require database to Helper Class
Browse files Browse the repository at this point in the history
  • Loading branch information
d-g-codappix committed Apr 24, 2024
1 parent 2e23ed6 commit 1aff255
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_imagefixedwidth';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][1]['CType'] = 'codappix_image';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

$pathinfo = pathinfo(__FILE__);
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
$configuration = include $path;
use Codappix\ContainerExample\Tests\Fixtures\RequireDatabase;

$configuration = RequireDatabase::getConfiguration(pathinfo(__FILE__));

$configuration['tt_content'][2]['CType'] = 'codappix_imagefixedwidth';

Expand Down
14 changes: 14 additions & 0 deletions Tests/Fixtures/container_example/Test/Fixtures/RequireDatabase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Codappix\ContainerExample\Tests\Fixtures;

class RequireDatabase
{
public static function getConfiguration(array $pathinfo): array
{
$path = $pathinfo['dirname'] . '/../Content/' . $pathinfo['basename'];
return require $path;
}
}
5 changes: 5 additions & 0 deletions Tests/Fixtures/container_example/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"description": "Add a container example for frontend tests",
"type": "typo3-cms-extension",
"license": "GPL-2.0-or-later",
"autoload-dev": {
"psr-4": {
"Codappix\\ContainerExample\\Tests\\": "Tests/"
}
},
"require": {
"typo3/cms-core": "*",
"b13/container": "*",
Expand Down

0 comments on commit 1aff255

Please sign in to comment.