diff --git a/src/Concerns/AsJob.php b/src/Concerns/AsJob.php index db0b876..acd7468 100644 --- a/src/Concerns/AsJob.php +++ b/src/Concerns/AsJob.php @@ -181,11 +181,6 @@ public static function assertPushedWith(Closure|array $callback, ?string $queue ); } - public static function assertPushedWithParamsOn(string $queue, Closure|array $callback): void - { - static::assertPushedWith($callback, $queue); - } - public static function assertNotPushedWith(Closure|array $callback): void { if (is_array($callback)) { diff --git a/tests/AsJobWithAssertionsTest.php b/tests/AsJobWithAssertionsTest.php index f36e0bc..f6490aa 100644 --- a/tests/AsJobWithAssertionsTest.php +++ b/tests/AsJobWithAssertionsTest.php @@ -164,50 +164,6 @@ public function handle(User $user): void AsJobWithAssertionsTest::assertPushedWith([$userB]); })->with('custom job decorators'); -it('asserts an action has been pushed with params on a given queue - success', function () { - loadMigrations(); - $user = createUser(); - - // When we dispatch the action with some parameters on "some-queue". - AsJobWithAssertionsTest::setQueue('some-queue'); - AsJobWithAssertionsTest::dispatch($user); - - // Then we can assert it has been dispatched with these parameters on that queue. - AsJobWithAssertionsTest::assertPushedWithParamsOn('some-queue', $user->is(...)); - AsJobWithAssertionsTest::assertPushedWithParamsOn('some-queue', [$user]); -})->with('custom job decorators'); - -it('asserts an action has been pushed with params on a given queue - failure (wrong params)', function () { - loadMigrations(); - $userA = createUser(); - $userB = createUser(); - - // When we dispatch the action with some parameters on "some-queue". - AsJobWithAssertionsTest::setQueue('some-queue'); - AsJobWithAssertionsTest::dispatch($userA); - - $this->expectException(ExpectationFailedException::class); - $this->expectExceptionMessage('The expected ['.AsJobWithAssertionsTest::class.'] job was not pushed'); - - // Then we can expect a failure when asserting it has been dispatched with other parameters on that queue. - AsJobWithAssertionsTest::assertPushedWithParamsOn('some-queue', $userB->is(...)); -})->with('custom job decorators'); - -it('asserts an action has been pushed with params on a given queue - failure (wrong queue)', function () { - loadMigrations(); - $user = createUser(); - - // When we dispatch the action with some parameters on "some-queue". - AsJobWithAssertionsTest::setQueue('some-queue'); - AsJobWithAssertionsTest::dispatch($user); - - $this->expectException(ExpectationFailedException::class); - $this->expectExceptionMessage('The expected ['.AsJobWithAssertionsTest::class.'] job was not pushed'); - - // Then we can expect a failure when asserting it has been dispatched with these parameters on some other queue. - AsJobWithAssertionsTest::assertPushedWithParamsOn('some-other-queue', $user->is(...)); -})->with('custom job decorators'); - it('asserts an action has not been pushed with params - success', function () { loadMigrations(); $userA = createUser();