duncan3dc / dusk

Use Dusk browser automation without the full Laravel framework
Apache License 2.0
80 stars 12 forks source link

Assert not found #5

Closed daviddarke closed 6 years ago

daviddarke commented 6 years ago

Hi there, using the script below:

<?php
use duncan3dc\Laravel\Dusk;

require __DIR__ . "/vendor/autoload.php";

$dusk = new Dusk;

$dusk->visit("http://example.com")
               ->assertPathIs('/home');

Gives me PHP Fatal error: Uncaught Error: Class 'PHPUnit\Framework\Assert' not found.

Something like:

<?php
use duncan3dc\Laravel\Dusk;

require __DIR__ . "/vendor/autoload.php";

$dusk = new Dusk;

$dusk->visit("http://example.com");
echo $dusk->element("h1")->getText() . "\n";

Works fine though

duncan3dc commented 6 years ago

Hi @daviddarke, it looks like upstream doesn't declare PHPUnit as a dependency, so it's not installed.

If you do composer require phpunit/phpunit that should resolve it for you.

I've submit a PR upstream to see if they'll resolve the issue there, if not I'll put a fix in here for it

duncan3dc commented 6 years ago

For some reason upstream have refused to declare their dependencies, so I've added one here to ensure phpunit is installed for you in 0.7.1

daviddarke commented 6 years ago

Great work! 😄