PHP code example of ohseesoftware / laravel-queue-fake

1. Go to this page and download the library: Download ohseesoftware/laravel-queue-fake library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ohseesoftware / laravel-queue-fake example snippets


// Given

// Queue is real there

// When
QueueFake::wrap(function () use (&$value) {
    // Queue is faked inside this function
});

// Queue is back to normal here

// Given
$user = null;
QueueFake::wrap(function () use (&$user) {
    // Queue is faked inside this function
    $user = factory(User::class)->create();
});

// When
// Queue is back to normal so we can dispatch, etc
SomeJob::dispatch($user);

// Then
$this->assertDatabaseHas('some-table', [
    'id' => 1
]);