fylzero fylzero
1

If you are testing with Dusk, do you need to also test with Jest?

I'm wondering if there is strong value in pulling Jest via vue-test-utils into a project? I haven't done much testing of Javascript and I'm looking for some thoughts...

PHPUnit and Model Refresh!

I'm trying to do a simple test, but, the only way I can make it green is by refreshing the post instance after the second patch request. My question is, I know how t...
brainbox brainbox
5

Github Actions + Dusk

For some reason I cannot get Dusk tests to successfully run with Github Actions. This is a fresh install of Laravel with only the example tests. See my example repo...
Testing
5
426
exSnake exSnake
4

With Refreshdatabase test fails

This is my test: use RefreshDatabase; /** @test */ public function an_operator_can_view_changes(){ $this->withoutExceptionHandling();...
keizah keizah
9

SQLite foreign key dont set null on delete in phpunit test

Hello, I have migration where I add foreign key to threads table (...
Testing
9
951
exSnake exSnake
4

Could a unit test use databases?

Could a unit test use databases? I mean, i want to make a test that assert if a give role has been assigned /** @test */ public function a_admin_i...
Testing
4
199
LittlePadawan LittlePadawan
8

Dusk - browser not popping up

Hello everyone, I tried to have an answer on the other topic but the topic is already solved for another problem. So I decided to open another one. When I run...
Testing
8
347
PWParsons PWParsons
4

How to test a view composer

I'm new to testing so please forgive me if I am missing something obvious. I'm trying to test the following view composer: namespace App\Http\View\Com...
Testing
4
365
Tsekka Tsekka
3

Laravel testing - can't connect to DB on Unit test (but works perfectly in Feature test)?

I have defined database on phpunit.xml. On my test I need to connect to database (Schema::getColumnListing('tablename');). Everything works perfe...
jgravois jgravois
6

I seem unable to grasp Testing and I am frustrated

While I understand the importance and value of TDD, I cannot seem to develop a workflow that is conducive to efficacy because I spend hours googling assertions and still ca...
Testing
6
347
jimmy.puckett jimmy.puckett
4

Testing package that uses Laravel Command (mocking something that you don't own)

So, we are updating our libraries to work with 5.2, and our laravel-garbage-man (https://github.com...
Testing
4
655
briankidd briankidd
4

Prevent other listeners during tests

For event listeners, I include a test to ensure I have the listener registered for the event - here's an example: /** @test */ function was_called_when_s...
Testing
4
224
nessor nessor
2

Dusk error when trying to update chrome driver

Hi guys, i have a problem with Laravel Dusk and PHP 7.4.5 via Xampp (see:...
Testing
2
315
hencca hencca
3

Mocked database class

Hi, I'm running Unit tests against a old codebase by other people. I would like to do as little changes to the codebase a s possible, preferably none. The codebase has a d...
Testing
3
225
PetroGromovo PetroGromovo
0

How to use mixing in cypress of vue/cli 4 app?

Hello, In vue/cli 4 app using cypress for testing I want to use my mixing and for this in my tests/e2e/specs/fileupload_tests.js I added declaration: import...
Perdanjam Perdanjam
10

Build a Laravel App With TDD - Episode 4, InvalidArgumentException: Unable to locate factory with name [default] [App\Project]

I am deep in bug town here, can anyone help? I am following the tutorial line by line and have got as far as the unit test in the episode:...
Testing
10
1519
jamie.cordingley jamie.cordingley
2

Getting session value from response

Hi All, I have a controller that when it creates / stores a record it redirects to a edit route, when testing i am using a factory make method for the record, postin...
Testing
2
328
xBnLEg6Fo xBnLEg6Fo
9

Random Dusk failures, caching issue?

Hello, I am using Laravel 6.18.14 and I'm currently facing big issues with Dusk. Sometimes the tests are not running at all, sometimes it helps to do...
Testing
9
409

array of object in request

i have this part of test , and i try to send documents as array of object not array of array , i used json decode ,Object() and did not work any idea?...
Testing
2
354
connecteev connecteev
0

Calling Stripe's javascript APIs from PHPUnit?

This may come off as a strange question, is there a way to call a javascript API from phpunit or laravel dusk? I need to call Stripe's Javascript API:...
connecteev connecteev
1

Factory error on calling $user->roles()->sync(1) from Unit Test

I'm seeing a weird error when I try to create my first unit test to create a user and call sync() class PaymentsAndSubscriptionsTest extends TestCase { /...
Testing
1
322
connecteev connecteev
8

Access 2 values from .env in phpunit.xml (without a new .env.testing file)

I am trying to ** read ** values from my .env file and access them in phpunit.xml Is there a way to do this? I do not want to define a new .env.testing file and have to mai...
Testing
8
449
swimmer swimmer
1

Laravel Dusk Test file not working

I tried to install Laravel Dusk with Laravel 5.8 I found that I need to change my .env APP_URL I tried the following two changes To put the value that I get w...
Testing
1
322
Charrua Charrua
1

Testing basics, unit testing method for boolean

Hello, I'm starting to write a unit test for a method. My method returns a boolean value, I can config world data and pass it to the method and expect an asser...
Testing
1
322
1stevengrant 1stevengrant
0

Dusk Pages failing on Faker calls

I've got a multi-step registration process that I'm trying to test with Dusk. I created 2 Dusk pages Register (email/password) and Personal (first...
Charrua Charrua
4

New to phpUnit tests, need help with repeating factories

I'm new to writing tests and I have started with an application that's already running and I have a few questions: I have my model Member with member da...
Testing
4
205
LittlePadawan LittlePadawan
12

How to repeat a dusk test ?

Hello everyone, I would like to know how to repeat a task to get all the combinasions. <?php namespace Tests\Browser; use Tests\DuskTestCase; use...
Testing
12
941
andremac96 andremac96
3

Laravel 5.6. Call to undefined method visit

Hi I'm trying to test for registration using laravel. $this->visit('/register') ->type('Andre', 'name') ->press('Register') -...
Testing
3
4214
drewdan drewdan
5

Testing local scopes

Has anyone seen documentation on how to test a local scope. My thought was to create the builder, and then asser the builder has the query I expect it too, but I am...
Testing
5
349

json structure

/** @test * */ public function planner_can_get_his_destinations_Cities_with_his_profile_via_api_v1() { $this->loginAs('planner',...
Testing
2
325
sfsccn sfsccn
5

Seeding/unseeding the database once per test class

The Problem I’d like to use setUpBeforeClass() rather than setUp() to seed my database for a test class. This is because I don’t want...
Testing
5
415
jamie.cordingley jamie.cordingley
3

Testing route with optional params

Hi All, I am relatively new to testing so just feeling it out at present. I have a post route which accepts multiple optional parameters (there are 10 in tota...
Testing
3
230
ShaneTurner ShaneTurner
18

phpunit.xml not being read, using variables from .env

I can't get tests to run from a testing environment, they always seem to run using the 'local' variables set in the .env file rather than the settings in phpunit.xml...
Testing
18
5405
trevorpan trevorpan
3

CSRF token mismatch. ($this->withoutExceptionHandling() not doing its job)

Hey there, The test suite passes sometimes but not others. I'm at a loss as to why this occurs randomly. Using sqlite, :memory: local env. /**...
Testing
3
360
Create a New Discussion Button