Skip to content

Commit 52049a1

Browse files
Merge pull request #34 from darkwebdesign/ISSUE-32
ISSUE-32: Update package for Doctrine 2.7
2 parents 0a69264 + 3cd6b6a commit 52049a1

31 files changed

Lines changed: 415 additions & 30 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[![Total Downloads](https://poser.pugx.org/darkwebdesign/doctrine-unit-testing/downloads?format=flat)](https://packagist.org/packages/darkwebdesign/doctrine-unit-testing)
55
[![License](https://poser.pugx.org/darkwebdesign/doctrine-unit-testing/license?format=flat)](https://packagist.org/packages/darkwebdesign/doctrine-unit-testing)
66

7-
[![Build Status](https://travis-ci.org/darkwebdesign/doctrine-unit-testing.svg?branch=2.6)](https://travis-ci.org/darkwebdesign/doctrine-unit-testing?branch=2.6)
7+
[![Build Status](https://travis-ci.org/darkwebdesign/doctrine-unit-testing.svg?branch=2.7)](https://travis-ci.org/darkwebdesign/doctrine-unit-testing?branch=2.7)
88
[![PHP Version](https://img.shields.io/badge/php-7.1%2B-777BB3.svg)](https://php.net/)
9-
[![Doctrine Version](https://img.shields.io/badge/doctrine-2.6-2E6BC8.svg)](http://www.doctrine-project.org/)
9+
[![Doctrine Version](https://img.shields.io/badge/doctrine-2.7-2E6BC8.svg)](http://www.doctrine-project.org/)
1010

1111
Doctrine Unit Testing makes the Doctrine internal test case classes available to use in your own projects
1212
unit tests.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
{"name": "Raymond Schouten"}
1010
],
1111
"require": {
12-
"doctrine/orm": "^2.6",
13-
"php": ">=7.1"
12+
"doctrine/orm": "^2.7",
13+
"php": "^7.1"
1414
},
1515
"autoload": {
1616
"psr-4": {

src/EventListener/CacheMetadataListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $event)
2828
$em = $event->getObjectManager();
2929

3030
/** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
31-
if (strstr($metadata->name, 'Doctrine\Tests\Models\Cache')) {
31+
if (strstr($metadata->name, 'DarkWebDesign\DoctrineUnitTesting\Models\Cache')) {
3232
return;
3333
}
3434

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DarkWebDesign\DoctrineUnitTesting\Mapping;
6+
7+
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
8+
use DarkWebDesign\DoctrineUnitTesting\VerifyDeprecations;
9+
use PHPUnit\Framework\TestCase;
10+
use const CASE_LOWER;
11+
12+
final class UnderscoreNamingStrategyTest extends TestCase
13+
{
14+
use VerifyDeprecations;
15+
16+
/** @test */
17+
public function checkDeprecationMessage() : void
18+
{
19+
$this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.');
20+
new UnderscoreNamingStrategy(CASE_LOWER, false);
21+
}
22+
}

src/Mocks/EntityManagerMock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static function create($conn, Configuration $config = null, EventManager
7171
if (null === $config) {
7272
$config = new Configuration();
7373
$config->setProxyDir(__DIR__ . '/../Proxies');
74-
$config->setProxyNamespace('Doctrine\Tests\Proxies');
74+
$config->setProxyNamespace('DarkWebDesign\DoctrineUnitTesting\Proxies');
7575
$config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([], true));
7676
}
7777
if (null === $eventManager) {

src/Models/CustomType/CustomIdObjectTypeChild.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CustomIdObjectTypeChild
1818
public $id;
1919

2020
/**
21-
* @ManyToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomIdObjectTypeParent", inversedBy="children")
21+
* @ManyToOne(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\CustomType\CustomIdObjectTypeParent", inversedBy="children")
2222
*/
2323
public $parent;
2424

src/Models/CustomType/CustomIdObjectTypeParent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CustomIdObjectTypeParent
1919
public $id;
2020

2121
/**
22-
* @OneToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomIdObjectTypeChild", cascade={"persist", "remove"}, mappedBy="parent")
22+
* @OneToMany(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\CustomType\CustomIdObjectTypeChild", cascade={"persist", "remove"}, mappedBy="parent")
2323
*/
2424
public $children;
2525

src/Models/CustomType/CustomTypeParent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ class CustomTypeParent
2020
public $customInteger;
2121

2222
/**
23-
* @OneToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeChild", cascade={"persist", "remove"})
23+
* @OneToOne(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\CustomType\CustomTypeChild", cascade={"persist", "remove"})
2424
*/
2525
public $child;
2626

2727
/**
28-
* @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", mappedBy="myFriends")
28+
* @ManyToMany(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\CustomType\CustomTypeParent", mappedBy="myFriends")
2929
*/
3030
private $friendsWithMe;
3131

3232
/**
33-
* @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", inversedBy="friendsWithMe")
33+
* @ManyToMany(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\CustomType\CustomTypeParent", inversedBy="friendsWithMe")
3434
* @JoinTable(
3535
* name="customtype_parent_friends",
3636
* joinColumns={@JoinColumn(name="customtypeparent_id", referencedColumnName="id")},

src/Models/DDC2372/Traits/DDC2372AddressTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
trait DDC2372AddressTrait
66
{
77
/**
8-
* @OneToOne(targetEntity="Doctrine\Tests\Models\DDC2372\DDC2372Address", inversedBy="user")
8+
* @OneToOne(targetEntity="DarkWebDesign\DoctrineUnitTesting\Models\DDC2372\DDC2372Address", inversedBy="user")
99
* @JoinColumn(name="address_id", referencedColumnName="id")
1010
*/
1111
private $address;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* @Entity(repositoryClass="DDC3231User1NoNamespaceRepository")
5+
* @Table(name="no_namespace_users")
6+
*/
7+
class DDC3231User1NoNamespace
8+
{
9+
/**
10+
* @Id
11+
* @Column(type="integer")
12+
* @GeneratedValue(strategy="AUTO")
13+
*/
14+
protected $id;
15+
16+
/**
17+
* @Column(type="string", length=255)
18+
*/
19+
protected $name;
20+
21+
}

0 commit comments

Comments
 (0)