Skip to content

[FEATURE] Laravel 6.0 #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3

before_script:
- travis_retry composer self-update
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ Version | Supported Laravel Versions | Support
1.2.x | 5.2.x, 5.3.x | Security releases
1.3.x | 5.4.x | Bugfix and security releases
1.4.x | 5.5.x | New features
1.5.x | 6.x | Laravel 6

Require this package

```bash
composer require "laravel-doctrine/orm:1.4.*"
composer require "laravel-doctrine/orm:1.5.*"
```

Because of the auto package discovery feature Laravel 5.5 has, the ServiceProvider and Facades are automatically registered.
Expand Down
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
],
"require": {
"php": ">=7.0",
"doctrine/orm": "2.5.*|2.6.*",
"illuminate/auth": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/console": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/container": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/pagination": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/routing": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/validation": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/view": "5.5.*|5.6.*|5.7.*|5.8.*",
"symfony/serializer": "^2.7|~3.0|~4.0"
"doctrine/orm": "^2.6|^2.7",
"illuminate/auth": "^6.0",
"illuminate/console": "^6.0",
"illuminate/container": "^6.0",
"illuminate/contracts": "^6.0",
"illuminate/pagination": "^6.0",
"illuminate/routing": "^6.0",
"illuminate/support": "^6.0",
"illuminate/validation": "^6.0",
"illuminate/view": "^6.0",
"symfony/serializer": "^2.7|^3.0|^4.0"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
"phpunit/phpunit": "^7.0",
"mockery/mockery": "^1.0",
"barryvdh/laravel-debugbar": "~2.0|~3.0",
"barryvdh/laravel-debugbar": "~3.0",
"itsgoingd/clockwork": "~1.9",
"illuminate/log": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/notifications": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/queue": "5.5.*|5.6.*|5.7.*|5.8.*"
"illuminate/log": "^6.0",
"illuminate/notifications": "^6.0",
"illuminate/queue": "^6.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix="Test.php">./tests/</directory>
Expand Down
3 changes: 2 additions & 1 deletion src/Configuration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace LaravelDoctrine\ORM\Configuration;

use Illuminate\Contracts\Container\Container;
use Illuminate\Support\Str;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;

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

// We'll check to see if a creator method exists for the given driver. If not we
// will check for a custom driver creator, which allows developers to create
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/TablePrefix/TablePrefixListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
$classMetadata = $eventArgs->getClassMetadata();

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

foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
Expand Down
3 changes: 2 additions & 1 deletion tests/Auth/DoctrineUserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
use LaravelDoctrine\ORM\Auth\DoctrineUserProvider;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class DoctrineUserProviderTest extends PHPUnit_Framework_TestCase
class DoctrineUserProviderTest extends TestCase
{
/**
* @var Mock
Expand Down
7 changes: 6 additions & 1 deletion tests/Auth/Passwords/DoctrineTokenRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
use LaravelDoctrine\ORM\Auth\Passwords\DoctrineTokenRepository;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class DoctrineTokenRepositoryTest extends PHPUnit_Framework_TestCase
class DoctrineTokenRepositoryTest extends TestCase
{
/**
* @var Mock
Expand Down Expand Up @@ -178,6 +179,8 @@ public function test_can_delete()
->andReturn(true);

$this->repository->delete(new UserMock);

$this->assertTrue(true);
}

public function test_can_delete_expired()
Expand All @@ -204,6 +207,8 @@ public function test_can_delete_expired()
->once();

$this->repository->deleteExpired();

$this->assertTrue(true);
}

protected function tearDown()
Expand Down
4 changes: 3 additions & 1 deletion tests/Configuration/Cache/AbstractCacheProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

abstract class AbstractCacheProviderTest extends PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

abstract class AbstractCacheProviderTest extends TestCase
{
abstract public function getProvider();

Expand Down
7 changes: 5 additions & 2 deletions tests/Configuration/Cache/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
use LaravelDoctrine\ORM\Configuration\Cache\FileCacheProvider;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class CacheManagerTest extends PHPUnit_Framework_TestCase
class CacheManagerTest extends TestCase
{
/**
* @var CacheManager
Expand Down Expand Up @@ -58,7 +59,7 @@ public function test_driver_can_return_a_given_driver()

public function test_cant_resolve_unsupported_drivers()
{
$this->setExpectedException(DriverNotFound::class);
$this->expectException(DriverNotFound::class);
$this->manager->driver('non-existing');
}

Expand All @@ -76,6 +77,8 @@ public function test_can_use_application_when_extending()
$this->manager->extend('new', function ($app) {
$this->assertInstanceOf(Container::class, $app);
});

$this->assertTrue(true);
}

public function test_can_replace_an_existing_driver()
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Cache/IlluminateCacheAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
use Illuminate\Contracts\Cache\Repository;
use LaravelDoctrine\ORM\Configuration\Cache\IlluminateCacheAdapter;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class IlluminateCacheAdapterTest extends PHPUnit_Framework_TestCase
class IlluminateCacheAdapterTest extends TestCase
{
/**
* @var IlluminateCacheAdapter
Expand Down
7 changes: 5 additions & 2 deletions tests/Configuration/Connections/ConnectionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\SqliteConnection;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class ConnectionManagerTest extends PHPUnit_Framework_TestCase
class ConnectionManagerTest extends TestCase
{
/**
* @var ConnectionManager
Expand Down Expand Up @@ -60,7 +61,7 @@ public function test_driver_can_return_a_given_driver()

public function test_cant_resolve_unsupported_drivers()
{
$this->setExpectedException(DriverNotFound::class);
$this->expectException(DriverNotFound::class);
$this->manager->driver('non-existing');
}

Expand All @@ -78,6 +79,8 @@ public function test_can_use_application_when_extending()
$this->manager->extend('new', function ($app) {
$this->assertInstanceOf(Container::class, $app);
});

$this->assertTrue(true);
}

public function test_can_replace_an_existing_driver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\MasterSlaveConnection;
use Mockery as m;
use PHPUnit\Framework\TestCase;

/**
* Basic unit tests for master slave connection.
*/
class MasterSlaveConnectionTest extends PHPUnit_Framework_TestCase
class MasterSlaveConnectionTest extends TestCase
{
/**
* Data provider for testMasterSlaveConnection.
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Connections/MysqlConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\MysqlConnection;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class MysqlConnectionTest extends PHPUnit_Framework_TestCase
class MysqlConnectionTest extends TestCase
{
/**
* @var Mock
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Connections/OracleConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\OracleConnection;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class OracleConnectionTest extends PHPUnit_Framework_TestCase
class OracleConnectionTest extends TestCase
{
/**
* @var Mock
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Connections/PgsqlConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\PgsqlConnection;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class PgsqlConnectionTest extends PHPUnit_Framework_TestCase
class PgsqlConnectionTest extends TestCase
{
/**
* @var Mock
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Connections/SqliteConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\SqliteConnection;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class SqliteConnectionTest extends PHPUnit_Framework_TestCase
class SqliteConnectionTest extends TestCase
{
/**
* @var Mock
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/Connections/SqlsrvConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use LaravelDoctrine\ORM\Configuration\Connections\SqlsrvConnection;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class SqlsrvConnectionTest extends PHPUnit_Framework_TestCase
class SqlsrvConnectionTest extends TestCase
{
/**
* @var Mock
Expand Down
5 changes: 3 additions & 2 deletions tests/Configuration/CustomTypeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use Doctrine\DBAL\DBALException;
use LaravelDoctrine\ORM\Configuration\CustomTypeManager;
use PHPUnit\Framework\TestCase;

class CustomTypeManagerTest extends PHPUnit_Framework_TestCase
class CustomTypeManagerTest extends TestCase
{
public function test_can_add_type()
{
Expand Down Expand Up @@ -40,7 +41,7 @@ public function test_can_add_multiple_types()

public function test_cannot_get_non_existing_type()
{
$this->setExpectedException(DBALException::class);
$this->expectException(DBALException::class);

$manager = new CustomTypeManager;
$manager->getType('non_existing');
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/LaravelNamingStategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use Illuminate\Support\Str;
use LaravelDoctrine\ORM\Configuration\LaravelNamingStrategy;
use PHPUnit\Framework\TestCase;

class LaravelNamingStrategyTest extends PHPUnit_Framework_TestCase
class LaravelNamingStrategyTest extends TestCase
{
/**
* @type LaravelNamingStrategy
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/MetaData/AnnotationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\Annotations;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class AnnotationsTest extends PHPUnit_Framework_TestCase
class AnnotationsTest extends TestCase
{
/**
* @var Annotations
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/MetaData/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use LaravelDoctrine\ORM\Configuration\MetaData\Config;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class ConfigTest extends PHPUnit_Framework_TestCase
class ConfigTest extends TestCase
{
/**
* @var Mock
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/MetaData/ConfigDriverTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

use LaravelDoctrine\ORM\Configuration\MetaData\Config\ConfigDriver;
use PHPUnit\Framework\TestCase;

class ConfigDriverTest extends PHPUnit_Framework_TestCase
class ConfigDriverTest extends TestCase
{
/**
* @var ConfigDriver
Expand Down
7 changes: 5 additions & 2 deletions tests/Configuration/MetaData/MetaDataManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use LaravelDoctrine\ORM\Configuration\MetaData\Yaml;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class MetaDataManagerTest extends PHPUnit_Framework_TestCase
class MetaDataManagerTest extends TestCase
{
/**
* @var MetaDataManager
Expand Down Expand Up @@ -45,7 +46,7 @@ public function test_driver_can_return_a_given_driver()

public function test_cant_resolve_unsupported_drivers()
{
$this->setExpectedException(DriverNotFound::class);
$this->expectException(DriverNotFound::class);
$this->manager->driver('non-existing');
}

Expand All @@ -63,6 +64,8 @@ public function test_can_use_application_when_extending()
$this->manager->extend('new', function ($app) {
$this->assertInstanceOf(Container::class, $app);
});

$this->assertTrue(true);
}

public function test_can_replace_an_existing_driver()
Expand Down
3 changes: 2 additions & 1 deletion tests/Configuration/MetaData/PhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\Php;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class PhpTest extends PHPUnit_Framework_TestCase
class PhpTest extends TestCase
{
/**
* @var Php
Expand Down
Loading