Skip to content

Commit b5a754c

Browse files
committed
Laravel 6 support
1 parent 65deec7 commit b5a754c

File tree

9 files changed

+36
-31
lines changed

9 files changed

+36
-31
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
],
1111
"license": "MIT",
1212
"require": {
13-
"php" : ">=7.1.3",
14-
"illuminate/support": "5.8.*",
15-
"illuminate/session": "5.8.*"
13+
"php" : ">=7.2",
14+
"illuminate/support": "6.*",
15+
"illuminate/session": "6.*"
1616
},
1717
"require-dev": {
18-
"mockery/mockery": "~0.9",
19-
"phpunit/phpunit": "~5.7"
18+
"mockery/mockery": "^1.0",
19+
"phpunit/phpunit": "^8.0"
2020
},
2121
"autoload": {
2222
"psr-0": {

phpunit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
>
1312
<testsuites>
1413
<testsuite name="Package Test Suite">

src/Krucas/Notification/Collection.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ public function __construct($items = [])
3636
*/
3737
public function add($item)
3838
{
39-
$this->queue->insert($item, is_null($item->getPosition()) ? null : -$item->getPosition());
39+
if (is_array($item)) {
40+
$position = $item['position'];
41+
} else {
42+
$position = $item->getPosition();
43+
}
44+
45+
$this->queue->insert($item, is_null($position) ? null : -$position);
4046

4147
$this->copyQueue(clone $this->queue);
4248

tests/CollectionTest.php

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

3-
use Mockery as m;
3+
use PHPUnit\Framework\TestCase;
44

5-
class CollectionTest extends PHPUnit_Framework_TestCase
5+
class CollectionTest extends TestCase
66
{
77
public function testCollectionConstructor()
88
{

tests/MessageTest.php

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

3-
use Mockery as m;
3+
use PHPUnit\Framework\TestCase;
44

5-
class MessageTest extends PHPUnit_Framework_TestCase
5+
class MessageTest extends TestCase
66
{
77
public function testMessageConstructor()
88
{

tests/Middleware/NotificationMiddlewareTest.php

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

33
use Mockery as m;
4+
use PHPUnit\Framework\TestCase;
5+
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
46

5-
class NotificationMiddlewareTest extends PHPUnit_Framework_TestCase
7+
class NotificationMiddlewareTest extends TestCase
68
{
7-
public function tearDown()
8-
{
9-
m::close();
10-
}
9+
use MockeryPHPUnitIntegration;
10+
1111

1212
public function testOnBoot()
1313
{

tests/NotificationBagTest.php

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

33
use Mockery as m;
4+
use PHPUnit\Framework\TestCase;
5+
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
46

57
require_once 'Mocks/NotificationsBagMock.php';
68

7-
class NotificationBagTest extends PHPUnit_Framework_TestCase
9+
class NotificationBagTest extends TestCase
810
{
9-
public function tearDown()
10-
{
11-
m::close();
12-
}
11+
use MockeryPHPUnitIntegration;
12+
1313

1414
public function testIsConstructed()
1515
{

tests/NotificationTest.php

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

33
use Mockery as m;
4+
use PHPUnit\Framework\TestCase;
5+
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
46

5-
class NotificationTest extends PHPUnit_Framework_TestCase
7+
class NotificationTest extends TestCase
68
{
7-
public function tearDown()
8-
{
9-
m::close();
10-
}
9+
use MockeryPHPUnitIntegration;
10+
1111

1212
public function testIsConstructed()
1313
{

tests/SubscriberTest.php

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

33
use Mockery as m;
4+
use PHPUnit\Framework\TestCase;
5+
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
46

5-
class SubscriberTest extends PHPUnit_Framework_TestCase
7+
class SubscriberTest extends TestCase
68
{
7-
public function tearDown()
8-
{
9-
m::close();
10-
}
9+
use MockeryPHPUnitIntegration;
10+
1111

1212
public function testIsConstructed()
1313
{

0 commit comments

Comments
 (0)