Skip to content

Commit 1aefb51

Browse files
committed
Changed infra test bootstrap path
1 parent c6de58c commit 1aefb51

File tree

6 files changed

+47
-34
lines changed

6 files changed

+47
-34
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,43 +56,43 @@ jobs:
5656
working-directory: ${{ matrix.module }}
5757
run: composer install --prefer-dist --no-progress --no-interaction
5858

59-
- name: Link monorepo directories to vendor
59+
- name: Copy monorepo directories to vendor
6060
working-directory: ${{ matrix.module }}
6161
run: |
6262
mkdir -p vendor/invertus
63-
ln -sf ${{ github.workspace }}/api vendor/invertus/api
64-
ln -sf ${{ github.workspace }}/core vendor/invertus/core
65-
ln -sf ${{ github.workspace }}/infrastructure vendor/invertus/infrastructure
66-
ln -sf ${{ github.workspace }}/presentation vendor/invertus/presentation
67-
ln -sf ${{ github.workspace }}/utility vendor/invertus/utility
63+
cp -r ${{ github.workspace }}/api vendor/invertus/
64+
cp -r ${{ github.workspace }}/core vendor/invertus/
65+
cp -r ${{ github.workspace }}/infrastructure vendor/invertus/
66+
cp -r ${{ github.workspace }}/presentation vendor/invertus/
67+
cp -r ${{ github.workspace }}/utility vendor/invertus/
6868
6969
- name: Run Infrastructure Unit Tests
7070
working-directory: ${{ matrix.module }}
7171
run: |
7272
php vendor/bin/phpunit \
73-
--configuration=../infrastructure/tests/phpunit.xml \
74-
--bootstrap=../infrastructure/tests/bootstrap.php
73+
--configuration=vendor/invertus/infrastructure/tests/phpunit.xml \
74+
--bootstrap=vendor/invertus/infrastructure/tests/bootstrap.php
7575
7676
- name: Run Utility Unit Tests
7777
working-directory: ${{ matrix.module }}
7878
run: |
7979
php vendor/bin/phpunit \
80-
--configuration=../utility/tests/phpunit.xml \
81-
--bootstrap=../utility/tests/bootstrap.php
80+
--configuration=vendor/invertus/utility/tests/phpunit.xml \
81+
--bootstrap=vendor/invertus/utility/tests/bootstrap.php
8282
8383
- name: Run Core Unit Tests
8484
working-directory: ${{ matrix.module }}
8585
run: |
8686
php vendor/bin/phpunit \
87-
--configuration=../core/tests/phpunit.xml \
88-
--bootstrap=../core/tests/bootstrap.php
87+
--configuration=vendor/invertus/core/tests/phpunit.xml \
88+
--bootstrap=vendor/invertus/core/tests/bootstrap.php
8989
9090
- name: Run Presentation Unit Tests
9191
working-directory: ${{ matrix.module }}
9292
run: |
9393
php vendor/bin/phpunit \
94-
--configuration=../presentation/tests/phpunit.xml \
95-
--bootstrap=../presentation/tests/bootstrap.php
94+
--configuration=vendor/invertus/presentation/tests/phpunit.xml \
95+
--bootstrap=vendor/invertus/presentation/tests/bootstrap.php
9696
9797
integration-tests:
9898
name: Integration Tests - ${{ matrix.module }} (PHP ${{ matrix.php-version }})
@@ -139,29 +139,29 @@ jobs:
139139
working-directory: ${{ matrix.module }}
140140
run: composer install --prefer-dist --no-progress --no-interaction
141141

142-
- name: Link monorepo directories to vendor
142+
- name: Copy monorepo directories to vendor
143143
working-directory: ${{ matrix.module }}
144144
run: |
145145
mkdir -p vendor/invertus
146-
ln -sf ${{ github.workspace }}/api vendor/invertus/api
147-
ln -sf ${{ github.workspace }}/core vendor/invertus/core
148-
ln -sf ${{ github.workspace }}/infrastructure vendor/invertus/infrastructure
149-
ln -sf ${{ github.workspace }}/presentation vendor/invertus/presentation
150-
ln -sf ${{ github.workspace }}/utility vendor/invertus/utility
146+
cp -r ${{ github.workspace }}/api vendor/invertus/
147+
cp -r ${{ github.workspace }}/core vendor/invertus/
148+
cp -r ${{ github.workspace }}/infrastructure vendor/invertus/
149+
cp -r ${{ github.workspace }}/presentation vendor/invertus/
150+
cp -r ${{ github.workspace }}/utility vendor/invertus/
151151
152152
- name: Run Infrastructure Integration Tests
153153
working-directory: ${{ matrix.module }}
154154
run: |
155155
php vendor/bin/phpunit \
156-
--configuration=../infrastructure/tests/phpunit-integration.xml \
157-
--bootstrap=../infrastructure/tests/bootstrap-integration.php
156+
--configuration=vendor/invertus/infrastructure/tests/phpunit-integration.xml \
157+
--bootstrap=vendor/invertus/infrastructure/tests/bootstrap-integration.php
158158
159159
- name: Run Core Integration Tests
160160
working-directory: ${{ matrix.module }}
161161
run: |
162162
php vendor/bin/phpunit \
163-
--configuration=../core/tests/phpunit-integration.xml \
164-
--bootstrap=../core/tests/bootstrap-integration.php
163+
--configuration=vendor/invertus/core/tests/phpunit-integration.xml \
164+
--bootstrap=vendor/invertus/core/tests/bootstrap-integration.php
165165
166166
- name: Run Module Integration Tests
167167
working-directory: ${{ matrix.module }}

core/tests/Unit/PayPal/OAuth/OAuthServiceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class OAuthServiceTest extends TestCase
3939
/** @var StreamInterface|MockObject */
4040
private $stream;
4141

42-
private OAuthService $oauthService;
42+
/** @var OAuthService */
43+
private $oauthService;
4344

4445
protected function setUp(): void
4546
{

core/tests/bootstrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,9 @@
3535
}
3636

3737
if (!defined('_PS_VERSION_')) {
38-
define('_PS_VERSION_', AppKernel::VERSION);
38+
if (class_exists('AppKernel')) {
39+
define('_PS_VERSION_', AppKernel::VERSION);
40+
} else {
41+
define('_PS_VERSION_', '1.7');
42+
}
3943
}

infrastructure/tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
require_once $rootDirectory . 'autoload.php';
3535
}
3636

37-
if (!defined('_PS_VERSION_')) {
37+
if (!defined('_PS_VERSION_') && class_exists('AppKernel')) {
3838
define('_PS_VERSION_', AppKernel::VERSION);
3939
}

presentation/tests/bootstrap.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* @copyright Since 2007 PrestaShop SA and Contributors
1818
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
1919
*/
20-
$rootDirectory = __DIR__ . '/../../../../../';
21-
$projectDir = __DIR__ . '/../../../';
20+
$rootDirectory = __DIR__ . '/../../../../../../';
21+
$projectDir = __DIR__ . '/../../../../';
2222

2323
if (!getenv('IS_CI')) {
2424
define('_PS_IN_TEST_', true);
@@ -35,5 +35,9 @@
3535
}
3636

3737
if (!defined('_PS_VERSION_')) {
38-
define('_PS_VERSION_', AppKernel::VERSION);
38+
if (class_exists('AppKernel')) {
39+
define('_PS_VERSION_', AppKernel::VERSION);
40+
} else {
41+
define('_PS_VERSION_', '1.7');
42+
}
3943
}

utility/tests/bootstrap.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
1919
*/
2020

21-
$rootDirectory = __DIR__ . '/../../../../../';
22-
$projectDir = __DIR__ . '/../../../';
21+
$rootDirectory = __DIR__ . '/../../../../../../';
22+
$projectDir = __DIR__ . '/../../../../';
2323

2424
if (!getenv('IS_CI')) {
2525
define('_PS_IN_TEST_', true);
@@ -36,5 +36,9 @@
3636
}
3737

3838
if (!defined('_PS_VERSION_')) {
39-
define('_PS_VERSION_', AppKernel::VERSION);
40-
}
39+
if (class_exists('AppKernel')) {
40+
define('_PS_VERSION_', AppKernel::VERSION);
41+
} else {
42+
define('_PS_VERSION_', '1.7');
43+
}
44+
}

0 commit comments

Comments
 (0)