Skip to content

Commit

Permalink
Merge release 3.4.3 into 3.5.x (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Apr 11, 2023
2 parents c52745b + fd39829 commit 6f86589
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@1.4.1"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.0.0"
19 changes: 10 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"

strategy:
matrix:
Expand All @@ -29,6 +29,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
dependencies:
- "highest"
stability:
Expand All @@ -46,11 +47,11 @@ jobs:
php-version: "7.3"
- dependencies: "highest"
stability: "dev"
php-version: "8.1"
php-version: "8.2"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

Expand Down Expand Up @@ -79,7 +80,7 @@ jobs:
if: "${{ contains(matrix.extra_constraint, '/') }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"
Expand All @@ -92,28 +93,28 @@ jobs:
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
uses: "actions/upload-artifact@v3"
if: "${{ ! contains(matrix.extra_constraint, '/') }}"
with:
name: "phpunit-${{ matrix.dependencies }}-${{ matrix.stability }}-${{ matrix.php-version }}.coverage"
path: "coverage.xml"

- name: "Upload coverage file, sanitize the name"
uses: "actions/upload-artifact@v2"
uses: "actions/upload-artifact@v3"
if: "${{ contains(matrix.extra_constraint, '/') }}"
with:
name: "phpunit-symfony-lts-${{ matrix.php-version }}.coverage"
path: "coverage.xml"

upload_coverage:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
needs:
- "phpunit"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

Expand All @@ -123,6 +124,6 @@ jobs:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
uses: "codecov/codecov-action@v3"
with:
directory: reports
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@1.4.1"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@3.0.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ on:

jobs:
static-analysis:
uses: "doctrine/.github/.github/workflows/static-analysis.yml@1.4.1"
with:
php-version: "8.1"
uses: "doctrine/.github/.github/workflows/static-analysis.yml@3.0.0"
2 changes: 2 additions & 0 deletions DependencyInjection/DoctrineFixturesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class DoctrineFixturesExtension extends Extension
{
/**
* {@inheritdoc}
*
* @return void
*/
public function load(array $configs, ContainerBuilder $container)
{
Expand Down
1 change: 1 addition & 0 deletions DoctrineFixturesBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

class DoctrineFixturesBundle extends Bundle
{
/** @return void */
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new FixturesCompilerPass());
Expand Down
40 changes: 40 additions & 0 deletions Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,43 @@ With the ``--purger`` option we can now specify to use ``my_purger`` instead of
.. _`Doctrine ORM`: https://symfony.com/doc/current/doctrine.html
.. _`DoctrineMongoDBBundle`: https://github.com/doctrine/DoctrineMongoDBBundle


How to load Fixtures from a different Directory
-----------------------------------------------
By default, fixtures are loaded from the ``src/DataFixtures`` directory.
In this example, we are going to load our DataFixtures from a new ``fixtures`` directory.

First, add a new ``PSR-4`` autoload-entry in the ``composer.json`` with the new ``fixtures`` directory:

.. code-block:: json
"autoload-dev": {
"psr-4": {
"...": "...",
"DataFixtures\\": "fixtures"
}
},
Then, enable Dependency Injection for the ``fixtures`` directory:

.. code-block:: php
// config/services.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
return function(ContainerConfigurator $container) : void {
$services = $container->services()
->defaults()
->autowire()
->autoconfigure();
$services->load('DataFixtures\\', '../fixtures');
};
.. caution::

This will not override the default ``src/DataFixtures`` directory when creating fixtures with the
`Symfony MakerBundle` (``make:fixtures``).

.. _`Symfony MakerBundle`: https://symfony.com/bundles/SymfonyMakerBundle/current/index.html
3 changes: 2 additions & 1 deletion Tests/IntegrationTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IntegrationTestKernel extends Kernel

public function __construct(string $environment, bool $debug)
{
$this->randomKey = rand(100, 999);
$this->randomKey = rand(10000000000, 99999999999);

parent::__construct($environment, $debug);
}
Expand Down Expand Up @@ -79,6 +79,7 @@ public function getLogDir(): string
return sys_get_temp_dir();
}

/** @return void */
protected function build(ContainerBuilder $container)
{
$container->addCompilerPass(new class implements CompilerPassInterface {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="DoctrineBundle for the Symfony Framework">
<testsuite name="DoctrineFixturesBundle for the Symfony Framework">
<directory>./Tests</directory>
</testsuite>
</testsuites>
Expand Down

0 comments on commit 6f86589

Please sign in to comment.