PHP code example of netsells / dredd-hooks-laravel
1. Go to this page and download the library: Download netsells/dredd-hooks-laravel 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/ */
netsells / dredd-hooks-laravel example snippets
namespace Tests\Dredd;
use Netsells\Dredd\Hook;
use Netsells\Dredd\Transaction;
use Illuminate\Support\Facades\Artisan;
use Netsells\Dredd\Kernel as DreddKernel;
class Kernel extends DreddKernel
{
public function handle(Hook $hook)
{
$this->beforeEach(function (Transaction &$transaction) {
Artisan::call('migrate:fresh');
Artisan::call('passport:install');
Artisan::call('db:seed');
});
$hook->group('Posts', Hooks\Posts::class);
}
}
yml
# This can be any single file which extends Netsells\Dredd\Kernel
hookfiles: 'tests/dredd/Kernel.php'
language: 'vendor/bin/dredd-hooks-laravel'
server: 'php -S 127.0.0.1:3000 ./vendor/netsells/dredd-hooks-laravel/server.php -t public/'
endpoint: 'http://127.0.0.1:3000'