Skip to content

Commit 9d6e4a8

Browse files
committed
[FEATURE] Update for Laravel 7
Also I have updated all tests to work with PHPUnit 8.5. All tests pass (with laravel-doctrine/orm 1.6 per PR laravel-doctrine/orm#438). Should be merged into a new branch: 1.2.
1 parent 98f5b4b commit 9d6e4a8

File tree

9 files changed

+40
-27
lines changed

9 files changed

+40
-27
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ composer.phar
33
composer.lock
44
.DS_Store
55
.php_cs.cache
6-
6+
.phpunit.result.cache
77
.idea
88
laravel-doctrine-orm.iml

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=7.2",
22-
"illuminate/auth": "^6.0",
23-
"illuminate/config": "^6.0",
24-
"illuminate/contracts": "^6.0",
25-
"illuminate/support": "^6.0",
26-
"illuminate/http": "^6.0",
27-
"laravel-doctrine/orm": "1.5.*"
21+
"php": ">=7.2.5",
22+
"illuminate/auth": "^7.0",
23+
"illuminate/config": "^7.0",
24+
"illuminate/contracts": "^7.0",
25+
"illuminate/support": "^7.0",
26+
"illuminate/http": "^7.0",
27+
"laravel-doctrine/orm": "1.6.*"
2828
},
2929
"suggest": {
3030
"gedmo/doctrine-extensions": "Behavioral Doctrine2 extensions (^2.4)",
3131
"beberlei/DoctrineExtensions": "Query/Type Doctrine2 extensions (^1.0)"
3232
},
3333
"require-dev": {
34-
"phpunit/phpunit": "^4.0",
35-
"mockery/mockery": "~0.9",
34+
"phpunit/phpunit": "^8.5",
35+
"mockery/mockery": "~1.3.1",
3636
"gedmo/doctrine-extensions": "^2.4",
3737
"beberlei/DoctrineExtensions": "^1.0"
3838
},

tests/BeberleiExtensionsServiceProviderTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use Illuminate\Contracts\Foundation\Application;
45
use LaravelDoctrine\Extensions\BeberleiExtensionsServiceProvider;
56
use LaravelDoctrine\ORM\DoctrineManager;
67
use Mockery as m;
78

8-
class BeberleiExtensionsServiceProviderTest extends PHPUnit_Framework_TestCase
9+
class BeberleiExtensionsServiceProviderTest extends TestCase
910
{
1011
/**
1112
* @var \Mockery\MockInterface|Application
@@ -22,12 +23,15 @@ class BeberleiExtensionsServiceProviderTest extends PHPUnit_Framework_TestCase
2223
*/
2324
protected $manager;
2425

25-
public function setUp()
26+
public function setUp(): void
2627
{
2728
$this->app = m::mock(Application::class);
2829
$this->manager = m::mock(DoctrineManager::class);
2930

3031
$this->provider = new BeberleiExtensionsServiceProvider($this->app);
32+
33+
// silence the 'This test did not perform any assertions' warning
34+
$this->assertTrue(true);
3135
}
3236

3337
public function test_custom_functions_can_be_registered()
@@ -37,7 +41,7 @@ public function test_custom_functions_can_be_registered()
3741
$this->provider->boot($this->manager);
3842
}
3943

40-
public function tearDown()
44+
public function tearDown(): void
4145
{
4246
m::close();
4347
}

tests/ExtensionTestCase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use Doctrine\Common\Annotations\Reader;
45
use Doctrine\Common\EventManager;
56
use Doctrine\ORM\EntityManagerInterface;
67
use Mockery as m;
78

8-
abstract class ExtensionTestCase extends PHPUnit_Framework_TestCase
9+
abstract class ExtensionTestCase extends TestCase
910
{
1011
/**
1112
* @var \Mockery\MockInterface|EventManager
@@ -22,15 +23,15 @@ abstract class ExtensionTestCase extends PHPUnit_Framework_TestCase
2223
*/
2324
protected $reader;
2425

25-
public function setUp()
26+
public function setUp(): void
2627
{
2728
$this->evm = m::mock(EventManager::class);
2829
$this->evm->shouldReceive('addEventSubscriber')->once();
2930

3031
$this->em = m::mock(EntityManagerInterface::class);
3132
$this->reader = m::mock(Reader::class);
3233
}
33-
public function tearDown()
34+
public function tearDown(): void
3435
{
3536
m::close();
3637
}

tests/IpTraceable/IpTraceableTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use LaravelDoctrine\Extensions\IpTraceable\IpTraceable;
45

5-
class IpTraceableTest extends PHPUnit_Framework_TestCase
6+
class IpTraceableTest extends TestCase
67
{
78
/**
89
* @var IpTraceableEntity
910
*/
1011
protected $entity;
1112

12-
public function setUp()
13+
public function setUp(): void
1314
{
1415
$this->entity = new IpTraceableEntity();
1516
}

tests/SoftDeletes/SoftDeletesTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use LaravelDoctrine\Extensions\SoftDeletes\SoftDeletes;
45

5-
class SoftDeletesTest extends PHPUnit_Framework_TestCase
6+
class SoftDeletesTest extends TestCase
67
{
78
/**
89
* @var SoftDeletesEntity
910
*/
1011
protected $entity;
1112

12-
public function setUp()
13+
public function setUp(): void
1314
{
1415
$this->entity = new SoftDeletesEntity();
1516
}

tests/Timestamps/TimestampsTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use LaravelDoctrine\Extensions\Timestamps\Timestamps;
45

5-
class TimestampsTest extends PHPUnit_Framework_TestCase
6+
class TimestampsTest extends TestCase
67
{
78
/**
89
* @var TimestampsEntity
910
*/
1011
protected $entity;
1112

12-
public function setUp()
13+
public function setUp(): void
1314
{
1415
$this->entity = new TimestampsEntity();
1516
}

tests/Tree/NestedSetTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use LaravelDoctrine\Extensions\Tree\NestedSet;
45

5-
class NestedSetTest extends PHPUnit_Framework_TestCase
6+
class NestedSetTest extends TestCase
67
{
78
/**
89
* @var NestedSetEntity
910
*/
1011
protected $entity;
1112

12-
public function setUp()
13+
public function setUp(): void
1314
{
1415
$this->entity = new NestedSetEntity();
1516
}

tests/Uploadable/UploadableExtensionServiceProviderTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use Gedmo\Uploadable\UploadableListener;
45
use Illuminate\Contracts\Foundation\Application;
56
use LaravelDoctrine\Extensions\Uploadable\UploadableExtensionServiceProvider;
67
use Mockery as m;
78

8-
class UploadableExtensionServiceProviderTest extends PHPUnit_Framework_TestCase
9+
class UploadableExtensionServiceProviderTest extends TestCase
910
{
1011
/**
1112
* @var \Mockery\MockInterface|Application
@@ -17,7 +18,7 @@ class UploadableExtensionServiceProviderTest extends PHPUnit_Framework_TestCase
1718
*/
1819
protected $provider;
1920

20-
public function setUp()
21+
public function setUp(): void
2122
{
2223
$this->app = m::mock(Application::class);
2324

@@ -31,9 +32,12 @@ public function test_listener_gets_bound_as_singleton()
3132
->with(UploadableListener::class);
3233

3334
$this->provider->register();
35+
36+
// silence the 'This test did not perform any assertions' warning
37+
$this->assertTrue(true);
3438
}
3539

36-
public function tearDown()
40+
public function tearDown(): void
3741
{
3842
m::close();
3943
}

0 commit comments

Comments
 (0)