From b893b6b56e840e65b88f7451ebd6d1501e8b247b Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Mon, 5 May 2025 15:34:59 -0400 Subject: [PATCH 1/2] DOCSP-49784: View file typo (#3376) (cherry picked from commit 0dc4a99819f2efad886dab7f6aa7c9a01fd2ddd3) --- docs/quick-start/view-data.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quick-start/view-data.txt b/docs/quick-start/view-data.txt index f29b2bd12..34be94e9e 100644 --- a/docs/quick-start/view-data.txt +++ b/docs/quick-start/view-data.txt @@ -105,9 +105,9 @@ View MongoDB Data .. code-block:: none :copyable: false - INFO View [resources/views/browse_movie.blade.php] created successfully. + INFO View [resources/views/browse_movies.blade.php] created successfully. - Open the ``browse_movie.blade.php`` view file in the ``resources/views`` + Open the ``browse_movies.blade.php`` view file in the ``resources/views`` directory. Replace the contents with the following code and save the changes: @@ -141,7 +141,7 @@ View MongoDB Data .. step:: Optionally, view your results as JSON documents - Rather than generating a view and editing the ``browse_movie.blade.php`` file, you can + Rather than generating a view and editing the ``browse_movies.blade.php`` file, you can use the ``toJson()`` method to display your results in JSON format. Replace the ``show()`` function with the following code to retrieve results and From c925e7bf0c9a0589e22282f8d9f850d0a8dc0611 Mon Sep 17 00:00:00 2001 From: norareidy Date: Mon, 5 May 2025 16:17:43 -0400 Subject: [PATCH 2/2] fix test --- tests/QueueTest.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/QueueTest.php b/tests/QueueTest.php index efc8f07ff..4de63391d 100644 --- a/tests/QueueTest.php +++ b/tests/QueueTest.php @@ -15,7 +15,7 @@ use MongoDB\Laravel\Queue\MongoQueue; use function app; -use function json_encode; +use function json_decode; class QueueTest extends TestCase { @@ -42,17 +42,16 @@ public function testQueueJobLifeCycle(): void $job = Queue::pop('test'); $this->assertInstanceOf(MongoJob::class, $job); $this->assertEquals(1, $job->isReserved()); - $this->assertEquals(json_encode([ - 'uuid' => $uuid, - 'displayName' => 'test', - 'job' => 'test', - 'maxTries' => null, - 'maxExceptions' => null, - 'failOnTimeout' => false, - 'backoff' => null, - 'timeout' => null, - 'data' => ['action' => 'QueueJobLifeCycle'], - ]), $job->getRawBody()); + $payload = json_decode($job->getRawBody(), true); + $this->assertEquals($uuid, $payload['uuid']); + $this->assertEquals('test', $payload['displayName']); + $this->assertEquals('test', $payload['job']); + $this->assertNull($payload['maxTries']); + $this->assertNull($payload['maxExceptions']); + $this->assertFalse($payload['failOnTimeout']); + $this->assertNull($payload['backoff']); + $this->assertNull($payload['timeout']); + $this->assertEquals(['action' => 'QueueJobLifeCycle'], $payload['data']); // Remove reserved job $job->delete();