Skip to content

Commit

Permalink
Merge pull request #489 from doctrine/1.7.x
Browse files Browse the repository at this point in the history
Merge 1.7.x up into 1.8.x
  • Loading branch information
greg0ire authored Nov 4, 2024
2 parents 3e95cef + 5ee102b commit eb2e07b
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 33 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "CI"
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.2.0"
12 changes: 7 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
if: "matrix.stability == 'dev'"

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

- name: "Upload coverage file"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "phpunit-${{ matrix.php-version }}.coverage"
name: "phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ matrix.stability }}.coverage"
path: "coverage.xml"

upload_coverage:
Expand All @@ -88,11 +88,13 @@ jobs:
fetch-depth: 2

- name: "Download coverage files"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v3"
uses: "codecov/codecov-action@v4"
with:
directory: "reports"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
20 changes: 20 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Documentation"

on:
pull_request:
branches:
- "*.x"
paths:
- ".github/workflows/documentation.yml"
- "docs/**"
push:
branches:
- "*.x"
paths:
- ".github/workflows/documentation.yml"
- "docs/**"

jobs:
documentation:
name: "Documentation"
uses: "doctrine/.github/.github/workflows/documentation.yml@5.2.0"
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@4.0.0"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.2.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
static-analysis:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/static-analysis.yml@4.0.0"
uses: "doctrine/.github/.github/workflows/static-analysis.yml@5.2.0"
26 changes: 11 additions & 15 deletions docs/en/sidebar.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
.. toc::
:orphan:

.. tocheader:: How-to guides
.. toctree::
:caption: How-to guides
:depth: 3

.. toctree::
:depth: 3
how-to/loading-fixtures
how-to/sharing-objects-between-fixtures
how-to/fixture-ordering

how-to/loading-fixtures
how-to/sharing-objects-between-fixtures
how-to/fixture-ordering
.. toctree::
:caption: Explanations
:depth: 3

.. toc::

.. tocheader:: Explanations

.. toctree::
:depth: 3

explanation/transactions-and-purging
explanation/transactions-and-purging
43 changes: 33 additions & 10 deletions tests/Common/DataFixtures/LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\Loader;
use Doctrine\Common\DataFixtures\ReferenceRepository;
use Doctrine\Common\DataFixtures\SharedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use TestFixtures\MyFixture1;
use TestFixtures\NotAFixture;

Expand All @@ -18,11 +20,9 @@ class LoaderTest extends BaseTestCase
public function testLoadFromDirectory(): void
{
$loader = new Loader();
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock1')->getMock());
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock2')->getMock());
$loader->addFixture(
$this->getMockBuilder(SharedFixtureInterface::class)->setMockClassName('Mock3')->getMock(),
);
$loader->addFixture(new DummyFixtureOne());
$loader->addFixture(new DummyFixtureTwo());
$loader->addFixture(new SharedDummyFixture());

$this->assertCount(3, $loader->getFixtures());

Expand All @@ -35,11 +35,9 @@ public function testLoadFromDirectory(): void
public function testLoadFromFile(): void
{
$loader = new Loader();
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock1')->getMock());
$loader->addFixture($this->getMockBuilder(FixtureInterface::class)->setMockClassName('Mock2')->getMock());
$loader->addFixture(
$this->getMockBuilder(SharedFixtureInterface::class)->setMockClassName('Mock3')->getMock(),
);
$loader->addFixture(new DummyFixtureOne());
$loader->addFixture(new DummyFixtureTwo());
$loader->addFixture(new SharedDummyFixture());

$this->assertCount(3, $loader->getFixtures());

Expand All @@ -63,3 +61,28 @@ public function testGetFixture(): void
$this->assertInstanceOf(MyFixture1::class, $fixture);
}
}

final class DummyFixtureOne implements FixtureInterface
{
public function load(ObjectManager $manager): void
{
}
}

final class DummyFixtureTwo implements FixtureInterface
{
public function load(ObjectManager $manager): void
{
}
}

final class SharedDummyFixture implements SharedFixtureInterface
{
public function load(ObjectManager $manager): void
{
}

public function setReferenceRepository(ReferenceRepository $referenceRepository): void
{
}
}

0 comments on commit eb2e07b

Please sign in to comment.