Unable to locate factory name[dafault] in laravel dataProvider

AM trying to use data provider in laravel where it throws The data provider specified for processing::testExample is invalid. Unable to locate factory with n...

DUSK - Scraping produces "Access Denied" 403 Error

I am attempting to use dusk to capture/scrap some data from an external site. I have replicated the manual Search form with dusk, and submit the form. "Access D...

PHPUnit says route not defined

Hi! If I run a test on a specific file and all the tests in it. PHPUnit says routes exists. But if I run all tests on all files in the Tests directory, PHPUnit fails with...
Testing
24
217

Trying to get property 'email' of non-object (only in Gitlab CI)

I recently started to use Gitlab CI a while most of it works like a charm, I'm facing a pretty strange issue. All my tests succeed locally, but running them in CI some of t...

QueryException: Database (test.sqlite) does not exist

The scenario is somewhat complicated since I use two connections, one of mysql and another sqlite in production. On the other hand, I have the App and several packages, sin...

Strategies for debugging phpunit in laravel

Below is my specific phpunit test failure but I'd like to generalize my question to ask others what are good strategies for debugging failed tests? In Laravel Dusk, for exa...

How to test NewSubcription without hitting Stripe API?

Hi guys, I'm currently working on a project which I'm setting up tests on, however I've hit a wall and I'm struggling to find out how to fix this. So, I have...

Dusk and Stripe

I can't seem to get Dusk to work with Stripe. The modal shows up, but it's not being detected and I can't find how to enter data in the fields. Has anyone got this...

Laravel 5.6 Dusk Click method fails to find element

I have an element <h1><a id="adminapprove" href="/admin/approve">Admin Tasks are Pending</a></h1>...

Dusk: ERR_UNKNOWN_URL_SCHEME

Started having trouble today running Dusk tests. I have multiple test files, with most containing multiple test. I started getting failures this morning, well, I not...

Testing Passport logout -- is it possible?

I'm trying to figure out how to test my Passport-driven logout function, which looks like this: public function logout() { $accessToken = auth()->...

Unable to mock the Config::get('configuration.here'); Facade method

All of the other Facade mocks work great, but this Config one in particular is acting as if it's not in test mode. I'll show you what I mean: class Stub {...
Testing
5
127

Laravel Dusk Screenshot show non English text

Every laravel dusk screenshot shows English text correctly, but not able to show non English text, it shows lots of squares instead. eg: Text in website is...

Dusk test works on isolation, breaks when run as part of the other tests.

I have a test file that is responsible for verifying a workflow that a user may take. For some reason, it seems like that when i run the test, the database is destro...

Testing Laravel command outpout

Laravel Framework 5.7.15 Using the documented way: $this->artisan('my:command') ->expectsOutput( "1 new thing:\n"....

Selecting elements in Laravel Dusk

I'm struggling to select certain elemets in Laravel Dusk. In paticular I have some checkboxes which are hidden that are recreated and styled in js/css. My HTML is so...
Testing
3
214

Testing Commands That Die

I've a command that drops the database and restores the structure from a schema dump, then calls migrate. I use it when I break my local db; it throws away the db and creat...

Manually Seed RefreshDatabase

I'm running some migrations with SQLite, and my tests are using the RefreshDatabase trait. I also have seeders (registered in the DatabaseSeeder.php file) that should seed...

How to change env variable / config in Dusk test?

I have a .env variable link to a Laravel config file which toggles certain section in my site. In Dusk testing I want to test that certain functionality is shown / hidden d...
Testing
7
135
Create a New Discussion Button
Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels