Skip to content

Commit

Permalink
The module module-doctrine2 is renamed to module-doctrine (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
TavoNiievez committed Feb 17, 2024
1 parent ef1bfbf commit b7499b6
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions composer.json
@@ -1,11 +1,11 @@
{
"name": "codeception/module-doctrine2",
"description": "Doctrine2 module for Codeception",
"name": "codeception/module-doctrine",
"description": "Doctrine module for Codeception",
"license": "MIT",
"type": "library",
"keywords": [
"codeception",
"doctrine2"
"doctrine"
],
"authors": [
{
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Expand Up @@ -5,8 +5,8 @@ parameters:
- tests
excludePaths:
analyse:
- tests/data/doctrine2_fixtures/TestFixture1.php
- tests/data/doctrine2_fixtures/TestFixture2.php
- tests/data/doctrine_fixtures/TestFixture1.php
- tests/data/doctrine_fixtures/TestFixture2.php
- tests/_support/UnitTester.php
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: true
Expand Down
18 changes: 9 additions & 9 deletions readme.md
@@ -1,11 +1,11 @@
# Codeception Module Doctrine2
# Codeception Module Doctrine

A Doctrine 2 module for Codeception.

[![Actions Status](https://github.com/Codeception/module-doctrine2/workflows/CI/badge.svg)](https://github.com/Codeception/module-doctrine2/actions)
[![Latest Stable Version](https://poser.pugx.org/codeception/module-doctrine2/v/stable)](https://github.com/Codeception/module-doctrine2/releases)
[![Total Downloads](https://poser.pugx.org/codeception/module-doctrine2/downloads)](https://packagist.org/packages/codeception/module-doctrine2)
[![License](https://poser.pugx.org/codeception/module-doctrine2/license)](/LICENSE)
[![Actions Status](https://github.com/Codeception/module-doctrine/workflows/CI/badge.svg)](https://github.com/Codeception/module-doctrine/actions)
[![Latest Stable Version](https://poser.pugx.org/codeception/module-doctrine/v/stable)](https://github.com/Codeception/module-doctrine/releases)
[![Total Downloads](https://poser.pugx.org/codeception/module-doctrine/downloads)](https://packagist.org/packages/codeception/module-doctrine)
[![License](https://poser.pugx.org/codeception/module-doctrine/license)](/LICENSE)

## Requirements

Expand All @@ -14,17 +14,17 @@ A Doctrine 2 module for Codeception.
## Installation

```
composer require "codeception/module-doctrine2" --dev
composer require "codeception/module-doctrine" --dev
```

## Documentation

See [the module documentation](https://codeception.com/docs/modules/Doctrine2).
See [the module documentation](https://codeception.com/docs/modules/Doctrine).

[Changelog](https://github.com/Codeception/module-doctrine2/releases)
[Changelog](https://github.com/Codeception/module-doctrine/releases)

## License

`Codeception Module Doctrine2` is open-sourced software licensed under the [MIT](/LICENSE) License.
`Codeception Module Doctrine` is open-sourced software licensed under the [MIT](/LICENSE) License.

© Codeception PHP Testing Framework
Expand Up @@ -47,7 +47,7 @@
* modules:
* enabled:
* - Symfony # 'ZF2' or 'Symfony'
* - Doctrine2:
* - Doctrine:
* depends: Symfony # Tells Doctrine to fetch the Entity Manager through Symfony
* cleanup: true # All doctrine queries will be wrapped in a transaction, which will be rolled back at the end of each test
* ```
Expand All @@ -57,22 +57,22 @@
* ```yaml
* modules:
* enabled:
* - Doctrine2:
* - Doctrine:
* connection_callback: ['MyDb', 'createEntityManager'] # Call the static method `MyDb::createEntityManager()` to get the Entity Manager
* ```
*
* By default, the module will wrap everything into a transaction for each test and roll it back afterwards
* (this is controlled by the `cleanup` setting).
* By doing this, tests will run much faster and will be isolated from each other.
*
* To use the Doctrine2 Module in acceptance tests, set up your `acceptance.suite.yml` like this:
* To use the Doctrine Module in acceptance tests, set up your `acceptance.suite.yml` like this:
*
* ```yaml
* modules:
* enabled:
* - Symfony:
* part: SERVICES
* - Doctrine2:
* - Doctrine:
* depends: Symfony
* ```
*
Expand All @@ -84,7 +84,7 @@
* ```yaml
* modules:
* enabled:
* - Doctrine2:
* - Doctrine:
* purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
* ```
*
Expand Down Expand Up @@ -146,7 +146,7 @@
*
* Note that key is ignored, because actual field name is part of criteria and/or expression.
*/
class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
class Doctrine extends CodeceptionModule implements DependsOnModule, DataMapper
{
private ?DoctrineProvider $dependentModule = null;

Expand All @@ -165,14 +165,14 @@ class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
modules:
enabled:
- Doctrine2:
- Doctrine:
connection_callback: [My\ConnectionClass, getEntityManager]
Or set a dependent module, which can be either Symfony or ZF2 to get EM from service locator:
modules:
enabled:
- Doctrine2:
- Doctrine:
depends: Symfony
EOF;

Expand Down Expand Up @@ -503,7 +503,7 @@ public function haveInRepository($classNameOrInstance, array $data = [])
} elseif (is_string($classNameOrInstance)) {
$instance = $this->instantiateAndPopulateEntity($classNameOrInstance, $data, $instances);
} else {
throw new InvalidArgumentException(sprintf('Doctrine2::haveInRepository expects a class name or instance as first argument, got "%s" instead', gettype($classNameOrInstance)));
throw new InvalidArgumentException(sprintf('Doctrine::haveInRepository expects a class name or instance as first argument, got "%s" instead', gettype($classNameOrInstance)));
}

// Flush all changes to database and then refresh all entities. We need this because
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/Codeception/Module/Doctrine2Test.php
Expand Up @@ -5,7 +5,7 @@
use Composer\InstalledVersions;
use Codeception\Exception\ModuleException;
use Codeception\Lib\ModuleContainer;
use Codeception\Module\Doctrine2;
use Codeception\Module\Doctrine;
use Codeception\Stub;
use Codeception\Test\Unit;
use Doctrine\Common\Collections\Criteria;
Expand All @@ -28,11 +28,11 @@
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;

final class Doctrine2Test extends Unit
final class DoctrineTest extends Unit
{
private ?EntityManager $em = null;

private ?Doctrine2 $module = null;
private ?Doctrine $module = null;

protected static function _setUpBeforeClass()
{
Expand All @@ -50,7 +50,7 @@ protected function _setUp()
$this->markTestSkipped('doctrine/orm is not installed');
}

$dir = __DIR__ . "/../../../data/doctrine2_entities";
$dir = __DIR__ . "/../../../data/doctrine_entities";

require_once $dir . "/CompositePrimaryKeyEntity.php";
require_once $dir . "/PlainEntity.php";
Expand Down Expand Up @@ -108,7 +108,7 @@ protected function _setUp()
]);

$container = Stub::make(ModuleContainer::class);
$this->module = new Doctrine2($container, [
$this->module = new Doctrine($container, [
'connection_callback' => fn(): EntityManager => $this->em,
]);

Expand All @@ -124,7 +124,7 @@ private function _preloadFixtures()
$this->markTestSkipped('doctrine/data-fixtures is not installed');
}

$dir = __DIR__ . "/../../../data/doctrine2_fixtures";
$dir = __DIR__ . "/../../../data/doctrine_fixtures";

require_once $dir . "/TestFixture1.php";
require_once $dir . "/TestFixture2.php";
Expand Down Expand Up @@ -201,7 +201,7 @@ public function testEmbeddable()
public function testQuirkyAssociationFieldNames()
{
// This test case demonstrates how quirky field names can interfere with parameter
// names generated within Doctrine2. Specifically, parameter name for entity's own field
// names generated within Doctrine. Specifically, parameter name for entity's own field
// '_assoc_val' clashes with parameter name for field 'val' of relation 'assoc'.

$this->module->dontSeeInRepository(AssociationHost::class, [
Expand Down

0 comments on commit b7499b6

Please sign in to comment.