andersfloor andersfloor
4

Dusk test does not see database update

I'm trying to replicate the Email verification lesson in Laravel 5.5 using Dusk for testing. I'm r...
Testing
4
327
mohammadkaab mohammadkaab
5

Migrate:rollback Is not working when test stop

Hi guys I have met a really new strange problem, Actually, I have started writing tests for my code (EtoE), now when I want to see the response of the API I need to put dd...
adnan483 adnan483
4

Laravel testing

hi, I'm new to testing, and I have there three tests, but they are not working, what is wrong here? /** @test */ public function can_add_new_company()...
mitechnologies mitechnologies
1

Laravel Dusk Error on Type

Hi.. I have been checking the new version of laravel 5.8 with: facebook/webdriver 1.7 Chromedrive 75 Laravel Dusk 5.1 This is my test public fu...
fahad fahad
3

Mock Error in PhpUnit test

I am always getting error while writing a simple test, don't know what's wrong there, any sort of help is highly appreciated. Method pluck(<Any Arguments&...
Testing
3
206
dust dust
25

Populating database with images with Faker

I want to populate my database with images and in my UserFactory.php I have: 'picture' => $faker->image('public/storage/images',400,300)...
Testing
25
6134
mitechnologies mitechnologies
3

Laravel Dusk Fails on LV 5.8

Hi, recently I have been having an issue with laravel dusk This is my test class ManageUsersTest extends DuskTestCase { use DatabaseMigrations;...
Testing
3
113
Breki Breki
1

(PHPStorm) PHPUnit tests towards dockerized database woes

First a quick note on my setup: I have a dev environment and a production environment, both running more or less the same code with APP_ENV and APP_URL being the onl...
paul-a-byford paul-a-byford
3

testing json and enum column types with sqlite

Hey Everyone, I attempted to switch to sqlite (in memory) to speed up running phpunit testing with the RefreshDatabase trait. Currently I'm using mysql and fou...
Testing
3
108
paul-a-byford paul-a-byford
2

SQLite :memory: testing results inconsistent with MySql?

Hey Everyone, I've got an app with API resources where I've been using MySql for php unit tests. I attempted to move across to use sqlite :memory: as the testing having rea...
chilitomato chilitomato
1

Storage Fake and Accessing "Real" Files

I put all of the data files my site requires under the storage/ directory and access them with functions from the Storage fascade. During testing I use S...
fastsol fastsol
1

request()->path() incorrect during testing

I am having a hard time figuring out a way to set the pathInfo within the request when testing. Here is the scenario: I am adding a global scope to a model in the boot()...
bencarter78 bencarter78
2

Setting up Dusk with testing database

Hello I'm having real issues with getting Dusk to work with a testing database. I seem to have gone through every piece of advice and still no luck. Dusk is not load...
ThePoet444 ThePoet444
0

Testing login listener with password rehash tips

I figure it's time I start to learn testing. With that in mind, I've went and stumped myself. I have a listener that catches for the auth attempting event. Basically, if th...
untymage untymage
1

Phpunit returns green on null

I'm trying to make sure my model have a path ( with a slug) but i dont even have a slug column on my table but it returns green: public...
hjortur17 hjortur17
8

Error while testing

I just created a new Laravel project and I get this when running my tests. Mockery\Exception\BadMethodCallException: Received Mockery_1_Illuminate_Console_Ou...
Testing
8
410
Danieloplata Danieloplata
2

Unexpected AuthenticationException

Hi guys, I recently upgraded a basic CRUD project from 5.7 to 5.8 and worked through fixing a few tests that now failed. I've sorted out all the important ones, but...
Testing
2
100
squibby squibby
8

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
8
530
danvim danvim
2

Mocking find($collection) in repository pattern in Laravel with Mockery

I'm doing unit testing and my repository has this method: /** * @param int|Collection $id * @return MyModel|Collection|null */ publi...
untymage untymage
2

Unit test for Many to Many Relationship

I'm trying to make sure that my many to many relationship will actually work but what is this error mean? Failed asserting that Illuminate\Database\Eloquent\...
Testing
2
121
dartika dartika
5

RefreshDatabase migration path

Hi! I've my migrations at differente default location (database/migrations/tenants/) and i want to use the RefreshDatabase trait, however it uses the default migrati...
Testing
5
241
ixudra ixudra
3

Mockery: cannot redeclare method

Updated my composer file and suddenly all my tests fail: - AccountControllerTest: Index PHP Fatal error: Cannot redeclare Mockery_0_Illuminate_Auth_Access_G...
Testing
3
216
secmuhammed secmuhammed
1

how to mock update eloquent method

Hello There, I've been trying to mock the eloquent update method while testing that a user can actually change his/her password, I tried to mock it, partially mock it and t...
JackJones JackJones
1

PhpStorm methods not found in PhpUnit tests

I'm getting the message in PhpStorm that methods such as click() and visit() don't exist on $this How can I make it so that Ph...
hjortur17 hjortur17
5

Help with test

Hi, I can't get this to work. /** @test */ public function a_user_can_filter_threads_by_popularity() { $threadWithTwoReplies = create('App\Th...
Testing
5
137
jediping jediping
1

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()->...
Testing
1
103
sirhxalot sirhxalot
3

Laravel Dusk - SweetAlert - AssertDialog

Hi Folks! I would like to write a Laravel Dusk Test in Laravel 5.8 in order to test dialogs. So far I have made a Vue Component that contains a button. When t...
Testing
3
162
wizjo wizjo
16

Phpunit configuration refresh my database

When I run phpunit --stop-on-failure command I got an error: Tests\Unit\ExampleTest::testBasicTest Illuminate\Database\QueryException: SQLST...
Testing
16
325
barrymcm barrymcm
4

Unit Test fails because the SUT tries to log an error.

When running a test that asserts an error is returned the SUT also tries to log an error but it cant because There is no existing directory at storage/logs and...
Testing
4
121
flyingL123 flyingL123
1

PHPUnit - Allowed memory size of 134217728 bytes exhausted

I'm seeing a strange error with a single PHPUnit test that I have written. I have a test suite of 346 tests. When I run all the tests with vendor/bin/phpunit e...
finchy70 finchy70
1

NotFoundHttpException in phpUnit caused by redirect()->route()

This simple test is failing. /** * @test */ public function it_can_create_a_job() { $client = create('App\Client'); $job =...
untymage untymage
4

is it safe to use double !! !! only for fetching data from server?

I wrote a unit test for my project that checks if the title exist on my page: $tag = factory(Tag::class)->create(['name' => 'Examp...
Testing
4
146
ThePoet444 ThePoet444
9

Laravel 5.7 dusk login testing fails with wrong credentials

I am writing code to transition users from our current php crypt(), to bcrypt. Which according to other tests i've written, seems to work. So now I'm checking the front end...
Testing
9
603
drewdan drewdan
0

Testing Guzzle Api Call

Hi All, I am trying to do a feature test which will validate that a user can pass data to insightly CRM. However, I of course only want to mock this, and not ping In...
zachleigh zachleigh
11

Unable to locate factory with name [default]??

Trying to get Auth up and running on a project and Im running into trouble making model factories for testing. Im getting the following error when trying to create a model...
Testing
11
4764
Create a New Discussion Button