PHP Classes

File: tests/Feature/Commands/OpenCommandTest.php

Recommend this page to a friend!
  Packages of Alberto Arena   Laravel Truss   tests/Feature/Commands/OpenCommandTest.php   Download  
File: tests/Feature/Commands/OpenCommandTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Laravel Truss
View a diagram of a Laravel application models
Author: By
Last change:
Date: 8 days ago
Size: 530 bytes
 

Contents

Class file image Download
<?php

declare(strict_types=1);

use
Illuminate\Support\Facades\Process;

it('prints the dashboard URL and opens it in the browser', function () {
   
Process::fake();
   
$url = route('truss.index');

   
$this->artisan('truss:open')
        ->
assertSuccessful()
        ->
expectsOutputToContain($url);

   
Process::assertRan(function ($process) use ($url) {
       
$command = is_array($process->command) ? implode(' ', $process->command) : (string) $process->command;

        return
str_contains($command, $url);
    });
});