Skip to content

Commit

Permalink
upgrade tests
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Aug 11, 2023
1 parent 8b8deb6 commit d8c2fff
Show file tree
Hide file tree
Showing 21 changed files with 119 additions and 118 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/codeception.yml
Expand Up @@ -15,10 +15,10 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_DB_DSN: "mysql://test:test@127.0.0.1:3306/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"
PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes/DataObject"

Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -82,9 +82,19 @@ jobs:
run: php -v

- name: Setup MySql
run: |
sudo systemctl start mysql
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
user: test
password: test
root-password: root
auto-start: true
my-cnf: |
max_allowed_packet=32505856
max_connections=1000
- name: Initial Database
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'

- name: Setup Chromium
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ecs.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php-stan.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -52,4 +52,4 @@ php-cgi.core
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,5 +1,5 @@
# License
Copyright (C) 2021 DACHCOM.DIGITAL
Copyright (C) 2023 DACHCOM.DIGITAL

This software is available under the GNU General Public License version 3 (GPLv3).

Expand Down
26 changes: 16 additions & 10 deletions README.md
Expand Up @@ -10,31 +10,37 @@ This bundle requires the `spatie/schema-org` package.

### Release Plan

| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|------------|
| **2.x** | `10.1` - `10.6` | `5.4` | -- | Feature Branch | dev-master |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 01.10.2019 | Unsupported | 1.x |
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|--------|
| **3x** | `11.0` | `6.2` | -- | Feature Branch | master |
| **2.x** | `10.1` - `10.6` | `5.4` | -- | Bugfixes | 2.x |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 01.10.2019 | Unsupported | 1.x |

## Installation

```json
"require" : {
"dachcom-digital/schema" : "~2.0.0",
"dachcom-digital/schema" : "~3.0.0",
}
```

- Execute: `$ bin/console pimcore:bundle:enable SchemaBundle`
Add Bundle to `bundles.php`:
```php
return [
SchemaBundle\SchemaBundle::class => ['all' => true],
];
```

- Execute: `$ bin/console pimcore:bundle:install SchemaBundle`

## Upgrading
- Execute: `$ bin/console doctrine:migrations:migrate --prefix 'SchemaBundle\Migrations'`
-
## Output

## Output
![image](https://user-images.githubusercontent.com/700119/65961347-a9e22000-e456-11e9-878e-d5df75536846.png)

##
Test your output on https://search.google.com/structured-data/testing-tool
> [!NOTE]
> Test your output on https://search.google.com/structured-data/testing-tool
### Further Information
- [Usage](docs/00_Usage.md)
Expand Down
8 changes: 4 additions & 4 deletions UPGRADE.md
@@ -1,11 +1,11 @@
# Upgrade Notes

## Migrating from Version 1.x to Version 2.0.0
## Migrating from Version 2.x to Version 3.0.0

### Global Changes
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
- Bumped `spatie/schema-org` from 2.x to 3.x
- Recommended folder structure by symfony adopted
- Minor code improvements

***

SchemaBundle 1.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-schema/blob/1.x/UPGRADE.md
SchemaBundle 2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-schema/blob/2.x/UPGRADE.md
9 changes: 5 additions & 4 deletions codeception.dist.yml
@@ -1,14 +1,15 @@
namespace: DachcomBundle\Test
support_namespace: Support
actor: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
output: tests/_output
log: tests/_output/var/logs
data: tests/_data
support: tests/Support
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
memory_limit: -1
colors: true
params:
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Expand Up @@ -16,7 +16,7 @@

"autoload": {
"psr-4": {
"SchemaBundle\\": "src/SchemaBundle"
"SchemaBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -32,18 +32,18 @@
}
},
"require": {
"pimcore/pimcore": "^10.1",
"pimcore/pimcore": "^11.0",
"spatie/schema-org": "^3.0"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-webdriver": "^1.4",
"codeception/module-symfony": "^1.6",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-symfony": "^0.12",
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"codeception/module-webdriver": "^4.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
},
"suggest": {
"dachcom-digital/seo": "^2.0"
"dachcom-digital/seo": "^3.0"
}
}
2 changes: 1 addition & 1 deletion config/services.yaml
@@ -1,2 +1,2 @@
imports:
- { resource: services/*.yml }
- { resource: services/*.yaml }
3 changes: 2 additions & 1 deletion docs/00_Usage.md
Expand Up @@ -7,7 +7,8 @@ If you're using the [SEO Bundle](https://github.com/dachcom-digital/pimcore-seo)

## SEO Bundle

> Note: this is the recommended way!
> [!NOTE]
> this is the recommended way!
This bundle detects automatically if you have installed the SEO Bundle. If so, it will disable the request event listener to keep things straight and prevent strategy mixes!
Please read [more about seo bundle configuration](./01_SeoBundleUsage.md) and how to configure this bundle if you're using this bundle in combination with the SEO Bundle.
Expand Down
3 changes: 2 additions & 1 deletion docs/02_StandaloneUsage.md
@@ -1,6 +1,7 @@
# Standalone Usage

> **Note!!** This does not work if you have installed the [SEO Bundle](https://github.com/dachcom-digital/pimcore-seo)!
> [!NOTE]
> This does not work if you have installed the [SEO Bundle](https://github.com/dachcom-digital/pimcore-seo)!
> Read more about it [here](./00_Usage.md)!
***
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Expand Up @@ -7,6 +7,6 @@ parameters:
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
constant_hassers: false
excludes_analyse:
excludePaths:
# as long we don't install the dependencies :(
- '*SchemaBundle/Seo/Middleware/SchemaGraphAdapter.php'
- src/Seo/Middleware/SchemaGraphAdapter.php
12 changes: 6 additions & 6 deletions tests/Functional.suite.dist.yml
@@ -1,12 +1,12 @@
actor: FunctionalTester
modules:
enabled:
- \Dachcom\Codeception\Helper\PimcoreCore:
- \Dachcom\Codeception\Support\Helper\PimcoreCore:
connect_db: true
rebootable_client: true
- \Dachcom\Codeception\Helper\PimcoreBundleCore:
- \Dachcom\Codeception\Support\Helper\PimcoreBundleCore:
run_installer: true
- \Dachcom\Codeception\Helper\Browser\PhpBrowser:
depends: \Dachcom\Codeception\Helper\PimcoreCore
- \Dachcom\Codeception\Helper\PimcoreBackend
- \Dachcom\Codeception\Helper\PimcoreUser
- \Dachcom\Codeception\Support\Helper\Browser\PhpBrowser:
depends: \Dachcom\Codeception\Support\Helper\PimcoreCore
- \Dachcom\Codeception\Support\Helper\PimcoreBackend
- \Dachcom\Codeception\Support\Helper\PimcoreUser
4 changes: 2 additions & 2 deletions tests/Support/FunctionalTester.php
@@ -1,8 +1,8 @@
<?php

namespace DachcomBundle\Test;
namespace DachcomBundle\Test\Support;

class FunctionalTester extends \Dachcom\Codeception\FunctionalTester
class FunctionalTester extends \Dachcom\Codeception\Support\FunctionalTester
{
use _generated\FunctionalTesterActions;
}
4 changes: 2 additions & 2 deletions tests/Support/UnitTester.php
@@ -1,8 +1,8 @@
<?php

namespace DachcomBundle\Test;
namespace DachcomBundle\Test\Support;

class UnitTester extends \Dachcom\Codeception\UnitTester
class UnitTester extends \Dachcom\Codeception\Support\UnitTester
{
use _generated\UnitTesterActions;
}
6 changes: 3 additions & 3 deletions tests/Unit.suite.dist.yml
@@ -1,8 +1,8 @@
actor: UnitTester
modules:
enabled:
- \Dachcom\Codeception\Helper\PimcoreCore:
- \Dachcom\Codeception\Support\Helper\PimcoreCore:
connect_db: true
- \Dachcom\Codeception\Helper\PimcoreBundleCore:
- \Dachcom\Codeception\Support\Helper\PimcoreBundleCore:
run_installer: true
- \Dachcom\Codeception\Helper\Unit
- \Dachcom\Codeception\Support\Helper\Unit
7 changes: 1 addition & 6 deletions tests/_bootstrap.php
@@ -1,8 +1,3 @@
<?php

$frameworkPath = getenv('PIMCORE_CODECEPTION_FRAMEWORK');
$bundleTestPath = getenv('TEST_BUNDLE_TEST_DIR');

$bootstrap = sprintf('%s/src/_bootstrap.php', $frameworkPath);

include_once $bootstrap;
include_once sprintf('%s/src/_bootstrap.php', getenv('PIMCORE_CODECEPTION_FRAMEWORK'));
11 changes: 7 additions & 4 deletions tests/_etc/config.yaml
@@ -1,7 +1,10 @@
bundles:
- { namespace: \Pimcore\Bundle\SeoBundle\PimcoreSeoBundle, priority: 0, execute_installer: true }
- { namespace: \SchemaBundle\SchemaBundle }
setup_files:
- { path: app/config.yml, dest: ./config/config.yaml }
- { path: app/system.yml, dest: ./var/config/system.yml }
- { path: app/controller/DefaultController.php, dest: ./src/Controller/DefaultController.php }
- { path: app/templates/default.html.twig, dest: ./templates/default/default.html.twig }
- { path: app/config.yaml, dest: ./config/ }
- { path: app/system_settings.yaml, dest: ./var/config/system_settings/ }
- { path: app/controller/DefaultController.php, dest: ./src/Controller/ }
- { path: app/templates/default.html.twig, dest: ./templates/default/ }
additional_composer_packages:
- { package: pimcore/admin-ui-classic-bundle, version: ^1.0 }

0 comments on commit d8c2fff

Please sign in to comment.