Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Feature/update to laravel 5 5 #25

Merged
merged 2 commits into from
Oct 9, 2017
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.6
- 7.0
- 7.1

Expand Down
23 changes: 15 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@
}
],
"require": {
"php": ">=5.6.4",
"illuminate/container": "5.4.*",
"illuminate/contracts": "5.4.*",
"illuminate/encryption": "5.4.*",
"illuminate/http": "5.4.*",
"illuminate/queue": "5.4.*",
"illuminate/support": "5.4.*",
"php": ">=7.0",
"illuminate/container": "5.5.*",
"illuminate/contracts": "5.5.*",
"illuminate/encryption": "5.5.*",
"illuminate/http": "5.5.*",
"illuminate/queue": "5.5.*",
"illuminate/support": "5.5.*",
"iron-io/iron_mq": "~4.0",
"jeremeamia/superclosure": "~2.0"
},
"require-dev": {
"mockery/mockery": "~0.9",
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~6.0"
},
"autoload": {
"psr-4": {
"Collective\\IronQueue\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Collective\\IronQueue\\IronQueueServiceProvider"
]
}
}
}
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
beStrictAboutTestsThatDoNotTestAnything="false"
>
<testsuites>
<testsuite name="Package Test Suite">
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package provides a IronMQ (~4.0 SDK) driver for the Laravel queue system an

## Installation
- composer require laravelcollective/iron-queue
- Add `Collective\IronQueue\IronQueueServiceProvider::class` to your `app.php` configuration file.
- Service Provider registration is done with [Package Auto-Discovery](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518)
- Configure your `iron` queue driver in your `config/queue.php` the same as it would have been configured for Laravel 5.1.

Sample Configuration:
Expand Down
3 changes: 2 additions & 1 deletion tests/IronJobTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

use Mockery as m;
use PHPUnit\Framework\TestCase;

class QueueIronJobTest extends PHPUnit_Framework_TestCase
class QueueIronJobTest extends TestCase
{
public function tearDown()
{
Expand Down
11 changes: 7 additions & 4 deletions tests/IronQueueTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

use Mockery as m;
use PHPUnit\Framework\TestCase;
use SuperClosure\Serializer;

class IronQueueTest extends PHPUnit_Framework_TestCase
class IronQueueTest extends TestCase
{
public function tearDown()
{
Expand All @@ -18,7 +19,8 @@ public function testPushProperlyPushesJobOntoIron()
$crypt->shouldReceive('encrypt')->once()->with(json_encode(['displayName' => 'foo', 'job' => 'foo', 'maxTries' => null, 'timeout' => null, 'data' => [1, 2, 3], 'queue' => 'default']))->andReturn('encrypted');
$queue = new Collective\IronQueue\IronQueue($iron, m::mock('Illuminate\Http\Request'), 'default', true);
$queue->setEncrypter($crypt);
$queue->push('foo', [1, 2, 3]);

$this->assertEquals(1, $queue->push('foo', [1, 2, 3]));
}

public function testPushProperlyPushesJobOntoIronWithoutEncryption()
Expand All @@ -29,7 +31,8 @@ public function testPushProperlyPushesJobOntoIronWithoutEncryption()
$crypt->shouldReceive('encrypt')->never();
$queue = new Collective\IronQueue\IronQueue($iron, m::mock('Illuminate\Http\Request'), 'default');
$queue->setEncrypter($crypt);
$queue->push('foo', [1, 2, 3]);

$this->assertEquals(1, $queue->push('foo', [1, 2, 3]));
}

public function testDelayedPushProperlyPushesJobOntoIron()
Expand All @@ -40,7 +43,7 @@ public function testDelayedPushProperlyPushesJobOntoIron()
$crypt->shouldReceive('encrypt')->once()->with(json_encode(['displayName' => 'foo', 'job' => 'foo', 'maxTries' => null, 'timeout' => null, 'data' => [1, 2, 3], 'queue' => 'default']))->andReturn('encrypted');
$queue = new Collective\IronQueue\IronQueue($iron, m::mock('Illuminate\Http\Request'), 'default', true);
$queue->setEncrypter($crypt);
$queue->later(5, 'foo', [1, 2, 3]);
$this->assertEquals(1, $queue->later(5, 'foo', [1, 2, 3]));
}

public function testPopProperlyPopsJobOffOfIron()
Expand Down