Skip to content

Commit cb35a8d

Browse files
committed
Fix CI pipeline errors
1 parent 8830e1f commit cb35a8d

File tree

15 files changed

+35
-74
lines changed

15 files changed

+35
-74
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"webmozart/assert": "^1.11"
4040
},
4141
"require-dev": {
42-
"api-platform/core": "^2.7 || ^3.4",
42+
"api-platform/core": "^4.0.3",
4343
"babdev/pagerfanta-bundle": "^4.4",
4444
"behat/behat": "^3.16",
4545
"doctrine/doctrine-bundle": "^2.11",
@@ -56,6 +56,7 @@
5656
"lexik/jwt-authentication-bundle": "^3.1",
5757
"matthiasnoback/symfony-config-test": "^4.3 || ^5.1",
5858
"matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.0",
59+
"payum/core": "^1.7.4",
5960
"phpspec/prophecy-phpunit": "^2.1",
6061
"phpunit/phpunit": "^9.6",
6162
"psalm/plugin-phpunit": "^0.18",

tests/Application/.env.test

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
APP_SECRET='ch4mb3r0f5ecr3ts'
2-
KERNEL_CLASS='Setono\SyliusTermsPlugin\Tests\Application\Kernel'
2+
3+
KERNEL_CLASS='Tests\Setono\SyliusTermsPlugin\Application\Kernel'
4+
5+
###> symfony/messenger ###
6+
# Sync transport turned for testing env for the ease of testing
7+
SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN=sync://
8+
SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=sync://
9+
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=sync://
10+
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=sync://
11+
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=sync://
12+
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN=sync://
13+
###< symfony/messenger ###

tests/Application/.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
!/public/media/image/.gitignore
99

1010
/node_modules
11-
/yarn.lock
12-
/package-lock.json
1311

1412
###> symfony/framework-bundle ###
1513
/.env.*.local
@@ -23,8 +21,3 @@
2321
###> symfony/web-server-bundle ###
2422
/.web-server-pid
2523
###< symfony/web-server-bundle ###
26-
27-
###> lexik/jwt-authentication-bundle ###
28-
/config/jwt/*.pem
29-
!/config/jwt/*-test.pem
30-
###< lexik/jwt-authentication-bundle ###

tests/Application/Kernel.php

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace Setono\SyliusTermsPlugin\Tests\Application;
5+
namespace Tests\Setono\SyliusTermsPlugin\Application;
66

77
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
8-
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
98
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
10-
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
119

1210
final class Kernel extends BaseKernel
1311
{
1412
use MicroKernelTrait;
15-
16-
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
17-
18-
public function getCacheDir(): string
19-
{
20-
return $this->getProjectDir() . '/var/cache/' . $this->environment;
21-
}
22-
23-
public function getLogDir(): string
24-
{
25-
return $this->getProjectDir() . '/var/log';
26-
}
27-
28-
public function registerBundles(): iterable
29-
{
30-
foreach ($this->getConfigurationDirectories() as $confDir) {
31-
$bundlesFile = $confDir . '/bundles.php';
32-
if (false === is_file($bundlesFile)) {
33-
continue;
34-
}
35-
yield from $this->registerBundlesFromFile($bundlesFile);
36-
}
37-
}
38-
39-
protected function configureRoutes(RoutingConfigurator $routes): void
40-
{
41-
foreach ($this->getConfigurationDirectories() as $confDir) {
42-
$this->loadRoutesConfiguration($routes, $confDir);
43-
}
44-
}
45-
46-
private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
47-
{
48-
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
49-
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS);
50-
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
51-
}
52-
53-
/**
54-
* @return BundleInterface[]
55-
*/
56-
private function registerBundlesFromFile(string $bundlesFile): iterable
57-
{
58-
$contents = require $bundlesFile;
59-
foreach ($contents as $class => $envs) {
60-
if (isset($envs['all']) || isset($envs[$this->environment])) {
61-
yield new $class();
62-
}
63-
}
64-
}
65-
66-
/**
67-
* @return string[]
68-
*/
69-
private function getConfigurationDirectories(): iterable
70-
{
71-
yield $this->getProjectDir() . '/config';
72-
}
7313
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
import '../../../../assets/shop/entrypoint';

tests/Application/bin/console

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env php
22
<?php
33

4-
use Setono\SyliusTermsPlugin\Tests\Application\Kernel;
4+
use Tests\Setono\SyliusTermsPlugin\Application\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
66
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\Debug\Debug;
7+
use Symfony\Component\ErrorHandler\Debug;
88

99
set_time_limit(0);
1010

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
setono_sylius_redirect_admin:
2+
resource: "@SetonoSyliusTermsPlugin/Resources/config/admin_routing.yaml"
3+
prefix: /admin

tests/Application/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
use Setono\SyliusTermsPlugin\Tests\Application\Kernel;
65
use Symfony\Component\ErrorHandler\Debug;
76
use Symfony\Component\HttpFoundation\Request;
7+
use Tests\Setono\SyliusTermsPlugin\Application\Kernel;
88

99
require dirname(__DIR__) . '/config/bootstrap.php';
1010

tests/Application/public/media/image/.gitignore

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<a class="item" href="{{ path('sylius_admin_dashboard') }}" style="padding: 13px 0;">
2+
<div style="max-width: 90px; margin: 0 auto;">
3+
<img src="{{ asset('build/admin/images/admin-logo.svg', 'admin') }}" class="ui fluid image">
4+
</div>
5+
</a>

0 commit comments

Comments
 (0)