Skip to content

Commit

Permalink
updating dependencies to update framework laravel to version 9 (#20)
Browse files Browse the repository at this point in the history
* updating dependencies to framework laravel to version 9

* stop to test cases

* makes this library compatible with laravel 7.0, 8.0, and 9.0, tested by php7.4 and php8.1

* remove redundant comments

Co-authored-by: Juan Lotito <[email protected]>
  • Loading branch information
Lotykun and Lotykun-Softonic authored Oct 18, 2022
1 parent edde057 commit f3cd163
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
"require": {
"php": ">=7.4",
"softonic/laravel-amqp": "2.1.0",
"laravel/framework": "^7.0 || ^8.0"
"laravel/framework": "^7.0 || ^8.0 || ^9.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"friendsofphp/php-cs-fixer": "^2.0 || ^3.0",
"laravel/legacy-factories": "^1.0.4",
"mockery/mockery": "^1.2",
"orchestra/testbench": "^6.0",
"orchestra/database": "^6.0",
"orchestra/testbench": "^6.0 || ^7.0",
"phpunit/phpunit": "^9.0",
"php-mock/php-mock-mockery": "^1.3"
},
Expand Down
15 changes: 13 additions & 2 deletions tests/Console/Commands/EmitAllEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

namespace Softonic\TransactionalEventPublisher\Tests\Console\Commands;

use Illuminate\Contracts\Bus\Dispatcher as BusDispatcherContract;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Softonic\TransactionalEventPublisher\EventStoreMiddlewares\AmqpMiddleware;
use Softonic\TransactionalEventPublisher\Jobs\SendDomainEvents;
use Softonic\TransactionalEventPublisher\Model\DomainEvent;
use Softonic\TransactionalEventPublisher\TestCase;
use Mockery;

class EmitAllEventsTest extends TestCase
{
Expand All @@ -30,7 +32,12 @@ public function setUp(): void
public function whenRunCommandItShouldResendAllTheCurrentDomainEvents(): void
{
factory(DomainEvent::class, 4)->create();
$this->expectsJobs(SendDomainEvents::class);

$mock = Mockery::mock(BusDispatcherContract::class);
$mock->shouldReceive('dispatch')->andReturnUsing(function ($dispatched) {
$this->dispatchedJobs[] = $dispatched;
});
$this->app->instance(BusDispatcherContract::class, $mock);
$this->app->register('Softonic\TransactionalEventPublisher\ServiceProvider');
$this->artisan('event-sourcing:emit-all')->run();

Expand All @@ -43,7 +50,11 @@ public function whenRunCommandItShouldResendAllTheCurrentDomainEvents(): void
public function whenRunCommandWithBatchSizeItShouldResendAllTheCurrentDomainEventsInBatch(): void
{
factory(DomainEvent::class, 4)->create();
$this->expectsJobs(SendDomainEvents::class);
$mock = Mockery::mock(BusDispatcherContract::class);
$mock->shouldReceive('dispatch')->andReturnUsing(function ($dispatched) {
$this->dispatchedJobs[] = $dispatched;
});
$this->app->instance(BusDispatcherContract::class, $mock);
$this->app->register('Softonic\TransactionalEventPublisher\ServiceProvider');
$this->artisan('event-sourcing:emit-all --batchSize=2')->run();

Expand Down

0 comments on commit f3cd163

Please sign in to comment.