PHP code example of fangx / testing-migration-command
1. Go to this page and download the library: Download fangx/testing-migration-command 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/ */
fangx / testing-migration-command example snippets
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Str;
abstract class TestCase extends BaseTestCase
{
// ...others
public function artisan($command, $parameters = [])
{
if (Str::startsWith($command, ['migrate', 'migration'])) {
$command = 'testing-' . $command;
}
return parent::artisan($command, $parameters);
}
}
php artisan testing-migrate
php artisan testing-migrate:rollback