Skip to content

Commit 14badce

Browse files
stephandesouzapatrickbrouwers
authored andcommitted
[FEATURE] Laravel 6.0 (#394)
Upgrade to Laravel 6.0
1 parent 0f26bd3 commit 14badce

File tree

55 files changed

+199
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+199
-109
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
4+
- 7.2
5+
- 7.3
66

77
before_script:
88
- travis_retry composer self-update

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ Version | Supported Laravel Versions | Support
5151
1.2.x | 5.2.x, 5.3.x | Security releases
5252
1.3.x | 5.4.x | Bugfix and security releases
5353
1.4.x | 5.5.x | New features
54+
1.5.x | 6.x | Laravel 6
5455

5556
Require this package
5657

5758
```bash
58-
composer require "laravel-doctrine/orm:1.4.*"
59+
composer require "laravel-doctrine/orm:1.5.*"
5960
```
6061

6162
Because of the auto package discovery feature Laravel 5.5 has, the ServiceProvider and Facades are automatically registered.

composer.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
],
1818
"require": {
1919
"php": ">=7.0",
20-
"doctrine/orm": "2.5.*|2.6.*",
21-
"illuminate/auth": "5.5.*|5.6.*|5.7.*|5.8.*",
22-
"illuminate/console": "5.5.*|5.6.*|5.7.*|5.8.*",
23-
"illuminate/container": "5.5.*|5.6.*|5.7.*|5.8.*",
24-
"illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*",
25-
"illuminate/pagination": "5.5.*|5.6.*|5.7.*|5.8.*",
26-
"illuminate/routing": "5.5.*|5.6.*|5.7.*|5.8.*",
27-
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*",
28-
"illuminate/validation": "5.5.*|5.6.*|5.7.*|5.8.*",
29-
"illuminate/view": "5.5.*|5.6.*|5.7.*|5.8.*",
30-
"symfony/serializer": "^2.7|~3.0|~4.0"
20+
"doctrine/orm": "^2.6|^2.7",
21+
"illuminate/auth": "^6.0",
22+
"illuminate/console": "^6.0",
23+
"illuminate/container": "^6.0",
24+
"illuminate/contracts": "^6.0",
25+
"illuminate/pagination": "^6.0",
26+
"illuminate/routing": "^6.0",
27+
"illuminate/support": "^6.0",
28+
"illuminate/validation": "^6.0",
29+
"illuminate/view": "^6.0",
30+
"symfony/serializer": "^2.7|^3.0|^4.0"
3131
},
3232
"require-dev": {
33-
"phpunit/phpunit": "~5.0",
33+
"phpunit/phpunit": "^7.0",
3434
"mockery/mockery": "^1.0",
35-
"barryvdh/laravel-debugbar": "~2.0|~3.0",
35+
"barryvdh/laravel-debugbar": "~3.0",
3636
"itsgoingd/clockwork": "~1.9",
37-
"illuminate/log": "5.5.*|5.6.*|5.7.*|5.8.*",
38-
"illuminate/notifications": "5.5.*|5.6.*|5.7.*|5.8.*",
39-
"illuminate/queue": "5.5.*|5.6.*|5.7.*|5.8.*"
37+
"illuminate/log": "^6.0",
38+
"illuminate/notifications": "^6.0",
39+
"illuminate/queue": "^6.0"
4040
},
4141
"autoload": {
4242
"psr-4": {

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
12-
>
11+
>
1312
<testsuites>
1413
<testsuite name="Package Test Suite">
1514
<directory suffix="Test.php">./tests/</directory>

src/Configuration/Manager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace LaravelDoctrine\ORM\Configuration;
44

55
use Illuminate\Contracts\Container\Container;
6+
use Illuminate\Support\Str;
67
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
78

89
abstract class Manager
@@ -78,7 +79,7 @@ public function driver($driver = null, array $settings = [], $resolve = true)
7879
*/
7980
protected function createDriver($driver, array $settings = [], $resolve = true)
8081
{
81-
$class = $this->getNamespace() . '\\' . studly_case($driver) . $this->getClassSuffix();
82+
$class = $this->getNamespace() . '\\' . Str::studly($driver) . $this->getClassSuffix();
8283

8384
// We'll check to see if a creator method exists for the given driver. If not we
8485
// will check for a custom driver creator, which allows developers to create

src/Extensions/TablePrefix/TablePrefixListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
4141
$classMetadata = $eventArgs->getClassMetadata();
4242

4343
if (!$classMetadata->isInheritanceTypeSingleTable() || $classMetadata->getName() === $classMetadata->rootEntityName) {
44-
$classMetadata->setTableName($this->prefix . $classMetadata->getTableName());
44+
$classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]);
4545
}
4646

4747
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {

tests/Auth/DoctrineUserProviderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
use LaravelDoctrine\ORM\Auth\DoctrineUserProvider;
99
use Mockery as m;
1010
use Mockery\Mock;
11+
use PHPUnit\Framework\TestCase;
1112

12-
class DoctrineUserProviderTest extends PHPUnit_Framework_TestCase
13+
class DoctrineUserProviderTest extends TestCase
1314
{
1415
/**
1516
* @var Mock

tests/Auth/Passwords/DoctrineTokenRepositoryTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
use LaravelDoctrine\ORM\Auth\Passwords\DoctrineTokenRepository;
99
use Mockery as m;
1010
use Mockery\Mock;
11+
use PHPUnit\Framework\TestCase;
1112

12-
class DoctrineTokenRepositoryTest extends PHPUnit_Framework_TestCase
13+
class DoctrineTokenRepositoryTest extends TestCase
1314
{
1415
/**
1516
* @var Mock
@@ -178,6 +179,8 @@ public function test_can_delete()
178179
->andReturn(true);
179180

180181
$this->repository->delete(new UserMock);
182+
183+
$this->assertTrue(true);
181184
}
182185

183186
public function test_can_delete_expired()
@@ -204,6 +207,8 @@ public function test_can_delete_expired()
204207
->once();
205208

206209
$this->repository->deleteExpired();
210+
211+
$this->assertTrue(true);
207212
}
208213

209214
protected function tearDown()

tests/Configuration/Cache/AbstractCacheProviderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
abstract class AbstractCacheProviderTest extends PHPUnit_Framework_TestCase
3+
use PHPUnit\Framework\TestCase;
4+
5+
abstract class AbstractCacheProviderTest extends TestCase
46
{
57
abstract public function getProvider();
68

tests/Configuration/Cache/CacheManagerTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
use LaravelDoctrine\ORM\Configuration\Cache\FileCacheProvider;
99
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
1010
use Mockery as m;
11+
use PHPUnit\Framework\TestCase;
1112

12-
class CacheManagerTest extends PHPUnit_Framework_TestCase
13+
class CacheManagerTest extends TestCase
1314
{
1415
/**
1516
* @var CacheManager
@@ -58,7 +59,7 @@ public function test_driver_can_return_a_given_driver()
5859

5960
public function test_cant_resolve_unsupported_drivers()
6061
{
61-
$this->setExpectedException(DriverNotFound::class);
62+
$this->expectException(DriverNotFound::class);
6263
$this->manager->driver('non-existing');
6364
}
6465

@@ -76,6 +77,8 @@ public function test_can_use_application_when_extending()
7677
$this->manager->extend('new', function ($app) {
7778
$this->assertInstanceOf(Container::class, $app);
7879
});
80+
81+
$this->assertTrue(true);
7982
}
8083

8184
public function test_can_replace_an_existing_driver()

0 commit comments

Comments
 (0)