Skip to content

Commit b7499b6

Browse files
authored
The module module-doctrine2 is renamed to module-doctrine (#28)
1 parent ef1bfbf commit b7499b6

26 files changed

+30
-30
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "codeception/module-doctrine2",
3-
"description": "Doctrine2 module for Codeception",
2+
"name": "codeception/module-doctrine",
3+
"description": "Doctrine module for Codeception",
44
"license": "MIT",
55
"type": "library",
66
"keywords": [
77
"codeception",
8-
"doctrine2"
8+
"doctrine"
99
],
1010
"authors": [
1111
{

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ parameters:
55
- tests
66
excludePaths:
77
analyse:
8-
- tests/data/doctrine2_fixtures/TestFixture1.php
9-
- tests/data/doctrine2_fixtures/TestFixture2.php
8+
- tests/data/doctrine_fixtures/TestFixture1.php
9+
- tests/data/doctrine_fixtures/TestFixture2.php
1010
- tests/_support/UnitTester.php
1111
checkMissingIterableValueType: false
1212
reportUnmatchedIgnoredErrors: true

readme.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Codeception Module Doctrine2
1+
# Codeception Module Doctrine
22

33
A Doctrine 2 module for Codeception.
44

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

1010
## Requirements
1111

@@ -14,17 +14,17 @@ A Doctrine 2 module for Codeception.
1414
## Installation
1515

1616
```
17-
composer require "codeception/module-doctrine2" --dev
17+
composer require "codeception/module-doctrine" --dev
1818
```
1919

2020
## Documentation
2121

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

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

2626
## License
2727

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

3030
© Codeception PHP Testing Framework

src/Codeception/Module/Doctrine2.php renamed to src/Codeception/Module/Doctrine.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* modules:
4848
* enabled:
4949
* - Symfony # 'ZF2' or 'Symfony'
50-
* - Doctrine2:
50+
* - Doctrine:
5151
* depends: Symfony # Tells Doctrine to fetch the Entity Manager through Symfony
5252
* cleanup: true # All doctrine queries will be wrapped in a transaction, which will be rolled back at the end of each test
5353
* ```
@@ -57,22 +57,22 @@
5757
* ```yaml
5858
* modules:
5959
* enabled:
60-
* - Doctrine2:
60+
* - Doctrine:
6161
* connection_callback: ['MyDb', 'createEntityManager'] # Call the static method `MyDb::createEntityManager()` to get the Entity Manager
6262
* ```
6363
*
6464
* By default, the module will wrap everything into a transaction for each test and roll it back afterwards
6565
* (this is controlled by the `cleanup` setting).
6666
* By doing this, tests will run much faster and will be isolated from each other.
6767
*
68-
* To use the Doctrine2 Module in acceptance tests, set up your `acceptance.suite.yml` like this:
68+
* To use the Doctrine Module in acceptance tests, set up your `acceptance.suite.yml` like this:
6969
*
7070
* ```yaml
7171
* modules:
7272
* enabled:
7373
* - Symfony:
7474
* part: SERVICES
75-
* - Doctrine2:
75+
* - Doctrine:
7676
* depends: Symfony
7777
* ```
7878
*
@@ -84,7 +84,7 @@
8484
* ```yaml
8585
* modules:
8686
* enabled:
87-
* - Doctrine2:
87+
* - Doctrine:
8888
* purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
8989
* ```
9090
*
@@ -146,7 +146,7 @@
146146
*
147147
* Note that key is ignored, because actual field name is part of criteria and/or expression.
148148
*/
149-
class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
149+
class Doctrine extends CodeceptionModule implements DependsOnModule, DataMapper
150150
{
151151
private ?DoctrineProvider $dependentModule = null;
152152

@@ -165,14 +165,14 @@ class Doctrine2 extends CodeceptionModule implements DependsOnModule, DataMapper
165165
166166
modules:
167167
enabled:
168-
- Doctrine2:
168+
- Doctrine:
169169
connection_callback: [My\ConnectionClass, getEntityManager]
170170
171171
Or set a dependent module, which can be either Symfony or ZF2 to get EM from service locator:
172172
173173
modules:
174174
enabled:
175-
- Doctrine2:
175+
- Doctrine:
176176
depends: Symfony
177177
EOF;
178178

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

509509
// Flush all changes to database and then refresh all entities. We need this because

tests/unit/Codeception/Module/Doctrine2Test.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Composer\InstalledVersions;
66
use Codeception\Exception\ModuleException;
77
use Codeception\Lib\ModuleContainer;
8-
use Codeception\Module\Doctrine2;
8+
use Codeception\Module\Doctrine;
99
use Codeception\Stub;
1010
use Codeception\Test\Unit;
1111
use Doctrine\Common\Collections\Criteria;
@@ -28,11 +28,11 @@
2828
use Symfony\Bridge\Doctrine\Types\UuidType;
2929
use Symfony\Component\Uid\Uuid;
3030

31-
final class Doctrine2Test extends Unit
31+
final class DoctrineTest extends Unit
3232
{
3333
private ?EntityManager $em = null;
3434

35-
private ?Doctrine2 $module = null;
35+
private ?Doctrine $module = null;
3636

3737
protected static function _setUpBeforeClass()
3838
{
@@ -50,7 +50,7 @@ protected function _setUp()
5050
$this->markTestSkipped('doctrine/orm is not installed');
5151
}
5252

53-
$dir = __DIR__ . "/../../../data/doctrine2_entities";
53+
$dir = __DIR__ . "/../../../data/doctrine_entities";
5454

5555
require_once $dir . "/CompositePrimaryKeyEntity.php";
5656
require_once $dir . "/PlainEntity.php";
@@ -108,7 +108,7 @@ protected function _setUp()
108108
]);
109109

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

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

127-
$dir = __DIR__ . "/../../../data/doctrine2_fixtures";
127+
$dir = __DIR__ . "/../../../data/doctrine_fixtures";
128128

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

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

0 commit comments

Comments
 (0)