Skip to content

Commit 833f228

Browse files
authored
Merge pull request #27 from MacPaw/develop
Release 3.0
2 parents c66b206 + b485886 commit 833f228

File tree

14 files changed

+93
-46
lines changed

14 files changed

+93
-46
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ jobs:
2222
- '6.1.*'
2323
- '6.2.*'
2424
- '7.0.*'
25+
doctrine-orm-versions:
26+
- '^2.17'
27+
- '^3.0'
2528
exclude:
2629
- php: '8.1'
2730
symfony-versions: '7.0.*'
31+
- doctrine-orm-versions: '^3.0'
32+
symfony-versions: '4.4.*'
2833
include:
2934
- description: 'Log Code Coverage'
3035
php: '8.2'
3136
coverage: 'xdebug'
37+
doctrine-orm-versions: '^3.0'
3238
symfony-versions: '^7.0'
3339

34-
name: PHP ${{ matrix.php }} ${{ matrix.description }}
40+
name: PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} Doctrine ${{ matrix.doctrine-orm-versions }} ${{ matrix.description }}
3541
steps:
3642
- name: Checkout
3743
uses: actions/checkout@v2
@@ -66,6 +72,7 @@ jobs:
6672
run: |
6773
composer require symfony/dependency-injection:${{ matrix.symfony-versions }} --no-update --no-scripts
6874
composer require symfony/http-kernel:${{ matrix.symfony-versions }} --no-update --no-scripts
75+
composer require doctrine/orm:${{ matrix.doctrine-orm-versions }} --no-update --no-scripts
6976
composer require --dev symfony/console:${{ matrix.symfony-versions }} --no-update --no-scripts
7077
composer require --dev symfony/property-access:${{ matrix.symfony-versions }} --no-update --no-scripts
7178
@@ -80,9 +87,8 @@ jobs:
8087
run: vendor/bin/phpunit --coverage-clover=coverage.xml
8188
if: matrix.coverage == 'xdebug'
8289

83-
- name: Run codecov
84-
uses: codecov/codecov-action@v1
90+
- name: Upload coverage reports to Codecov
8591
if: matrix.coverage == 'xdebug'
92+
uses: codecov/codecov-action@v4.0.1
8693
with:
87-
file: './coverage.xml'
88-
fail_ci_if_error: true
94+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/package-lock.json
66
/node_modules/
77
/.idea/
8+
/coverage
9+
/clover.xml

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,23 @@
2929
"require": {
3030
"php": "^7.4 || ^8.0",
3131
"behat/behat": "^3.0",
32-
"doctrine/orm": "^2.0",
32+
"doctrine/orm": "^2.0 || ^3.0",
3333
"doctrine/doctrine-bundle": "^2.0",
3434
"doctrine/doctrine-fixtures-bundle": "^3.0",
3535
"doctrine/doctrine-migrations-bundle": "^3.0",
3636
"theofidry/alice-data-fixtures": "^1.0",
3737
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0 || ^7.0",
38-
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0 || ^7.0"
38+
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0 || ^7.0",
39+
"doctrine/dbal": "^2.0 || ^3.0"
3940
},
4041
"require-dev": {
4142
"phpstan/phpstan": "^1.2",
4243
"phpunit/phpunit": "^9.5",
4344
"slevomat/coding-standard": "^7.0",
4445
"squizlabs/php_codesniffer": "^3.6",
4546
"symfony/console": "^4.4 || ^5.4 || ^6.0 || ^7.0",
46-
"symfony/property-access": "^4.4 || ^5.4 || ^6.0 || ^7.0"
47+
"symfony/property-access": "^4.4 || ^5.4 || ^6.0 || ^7.0",
48+
"symplify/config-transformer": "^12.3"
4749
},
4850
"autoload": {
4951
"psr-4": {

phpstan-baseline.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ parameters:
1212
message: '#Offset (.*)? does not exist on array\{(.*)?\}.#'
1313
count: 1
1414
path: ./src/Database/Manager/SqliteDatabaseManager.php
15+
-
16+
identifier: missingType.iterableValue

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ includes:
33

44
parameters:
55
level: max
6-
checkMissingIterableValueType: false
76
paths:
87
- src/

src/Database/Manager/SqliteDatabaseManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ private function adaptDatabaseSchemaToSqlite(Schema $schema): void
108108
{
109109
foreach ($schema->getTables() as $table) {
110110
foreach ($table->getColumns() as $column) {
111-
if ($column->hasCustomSchemaOption('collation')) {
112-
$column->setCustomSchemaOptions(array_diff_key(
113-
$column->getCustomSchemaOptions(),
111+
if ($column->hasPlatformOption('collation')) {
112+
$column->setPlatformOptions(array_diff_key(
113+
$column->getPlatformOptions(),
114114
['collation' => true]
115115
));
116116
}

tests/Functional/App/TestKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function registerBundles(): iterable
2929

3030
public function registerContainerConfiguration(LoaderInterface $loader): void
3131
{
32-
$loader->load(__DIR__ . '/config/doctrine.yml');
33-
$loader->load(__DIR__ . '/config/doctrine_migrations.yml');
32+
$loader->load(__DIR__ . '/config/doctrine.php');
33+
$loader->load(__DIR__ . '/config/doctrine_migrations.php');
3434
$loader->load(__DIR__ . '/config/behat_doctrine_fixtures.yml');
3535
}
3636

@@ -43,4 +43,4 @@ public function getProjectDir(): string
4343
{
4444
return __DIR__;
4545
}
46-
}
46+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('doctrine', [
9+
'dbal' => [
10+
'url' => 'sqlite:///%kernel.cache_dir%/data.db',
11+
'options' => [
12+
'collation' => 'utf8mb4_unicode_ci',
13+
],
14+
],
15+
'orm' => [
16+
'auto_generate_proxy_classes' => true,
17+
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
18+
'auto_mapping' => true,
19+
'mappings' => [
20+
'App' => [
21+
'is_bundle' => false,
22+
'type' => 'xml',
23+
'dir' => '%kernel.project_dir%/config/doctrine_entity',
24+
'prefix' => 'BehatDoctrineFixtures\Tests\Functional\App\Entity',
25+
'alias' => 'App',
26+
],
27+
],
28+
],
29+
]);
30+
};

tests/Functional/App/config/doctrine.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
5+
<entity name="BehatDoctrineFixtures\Tests\Functional\App\Entity\BaseEntity" table="base_entity">
6+
<id name="id" type="integer">
7+
<generator strategy="AUTO"/>
8+
<options>
9+
<option name="collation">utf8_unicode_ci</option>
10+
</options>
11+
</id>
12+
</entity>
13+
</doctrine-mapping>

tests/Functional/App/config/doctrine_entity/BaseEntity.orm.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('doctrine_migrations', [
9+
'storage' => [
10+
'table_storage' => [
11+
'table_name' => 'migration_versions',
12+
],
13+
],
14+
'migrations_paths' => [
15+
'BehatDoctrineFixtures\Tests\Functional\App\Migrations' => '%kernel.project_dir%/Migrations',
16+
],
17+
'organize_migrations' => 'BY_YEAR',
18+
'custom_template' => '%kernel.project_dir%/config/doctrine_migrations.template',
19+
]);
20+
};

tests/Functional/App/config/doctrine_migrations.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/Functional/Database/DatabaseHelperTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ protected function setUp(): void
1717
{
1818
parent::setUp();
1919

20-
exec('tests/Functional/App/bin/console doctrine:database:create --no-interaction');
21-
exec('tests/Functional/App/bin/console d:mi:mi --no-interaction');
20+
exec('XDEBUG_MODE=off tests/Functional/App/bin/console doctrine:database:create --no-interaction');
21+
exec('XDEBUG_MODE=off tests/Functional/App/bin/console d:mi:mi --no-interaction');
22+
exec('rm -rf tests/Functional/App/var/cache/*');
2223
}
2324

2425
protected function tearDown(): void
2526
{
2627
parent::setUp();
2728

28-
exec('tests/Functional/App/bin/console d:d:d --force --no-interaction');
29+
exec('XDEBUG_MODE=off tests/Functional/App/bin/console d:d:d --force --no-interaction');
2930
}
3031

3132
public function testLoadFixtures(): void

0 commit comments

Comments
 (0)