acacha acacha
7

How to disable headless mode in Laravel 5.5 (Dusk 2.0)?

Now Laravel 5.5 uses Dusk 2.0 with headless mode active by default. Anybody know how to change this to execute Laravel Dusk tests like before (seeing the browser opening an...
Testing
7
150
Kel_ Kel_
11

What is going on?

I have two tests: /** @test */ public function a_project_requires_a_title() { $attributes = factory('App\Project')->raw(['title' => '']...
Testing
11
100
Thyrosis Thyrosis
10

Custom service provider gives Purify errors in PHPUnit test

Hi guys, This is a weird one. I'm trying to add some extra allowable HTML elements to Steve Baumans' Purify. It takes a custom ServiceProvider, seeing as the...
Testing
10
90
kazi-shahin kazi-shahin
25

Artisan serve can not open Localhost

Hello, I'm new in Laravel. Running Ubuntu as my OS and LAMP is install in my laptop. After create a new laravel project. Once I command php artisan serve, Browser c...
Testing
25
777
james_fairhurst james_fairhurst
1

View::share() & $this->assertViewHas() not working when testing a Controller

Has anyone come across the issue when testing $this->assertViewHas() with variables set using View::share() They don't seem to e...
Tim-KH Tim-KH
1

Testing connected Methods

Im pretty new to testing and I have written a little test to see if everything is working correctly when a user adds a YouTube Video to the App (Via a simple CRUD)....
successdav successdav
3

Mail test not passing

I am following up a laracast video on sending mails but my test is not passing... My test class use DatabaseMigrations; /** @test */ publ...
mkdesign82 mkdesign82
1

page expiration - laravel dusk

Hi, I'm running laravel dusk on the gitlab CI, when I submitting the form this error show's to me. The page has expired due to inactivity please refresh and try again....
webdevnwuk webdevnwuk
2

Laravel PHPStorm PHPUnit

Has anyone managed to configure phpstorm to use phpunit? The only instructions just keep telling me how easy it is to add a new test (id reather use live templates anyway)...
Testing
2
109
longestdrive longestdrive
2

Accessing FormRequest values during testing

Hi I’m trying to test the effectiveness of a rule within a form request. The rule is: ‘date’ => [ Rule::unique('orders')->where(funct...
imirko imirko
4

assertSee on a non existing property returns green

Hello everyone, I have a couple of years of experience with Laravel but I am completely new to TDD world. Just learning and Laracasts has been a great resource, as a...
PatrickSJ PatrickSJ
1

How to have JSON_NUMERIC_CHECK applied on test response?

If I take an object and assert a JSON response has it using $response->assertJsonFragment($new_labor->toArray()); then it fails with float/decimal number...
jijoel jijoel
1

How do we turn event handling back on for test after ->withoutEvents?

I have a class that emits an event which ultimately sends an email. For most of the tests for that class, I don't want an email sent, so this is my setUp function:...
dust dust
24

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
24
1284
miwal miwal
0

General question about what kind of data to put in a database seed, given now starting to use automated tests in earnest.

I'm finally starting to engage with testing in earnest -- tried phpspec but decided to stick with phpunit to start with because it is a more comprehensive solution rather t...
ritey ritey
11

Unit Testing using different sqlite file - connection override in model

I'm hoping someone can either explain what I'm doing wrong, or whether this is just the way it is. My setup is as follows: Default connection string: default (...
Testing
11
79
Illas Illas
2

Laravel Dusk incorrectly reporting OK and stopping

I have a 2-level loop inside $this->browse(function (Browser $browser)... and upon certain conditions the testing returns OK when it should report a failure....
DawgOnKing DawgOnKing
1

Testing Auth

Why is this failing? public function test_a_user_registers_with_good_seniority_and_verifies_email() { //Visit Register Page $response = $...
squibby squibby
4

How to test json structure with phpunit?

I return JSON in a structure like below. It returns users or contacts. The data returned for users is different to contacts. { "data": [ {...
Testing
4
759
alex_time alex_time
3

[closed] Laravel 5.7 TDD Routes flushed after first test method executed

I am facing a strange behavior trying to explore the TDD world. I have made two test methods on the same test class. Each test method is isolated from others, in fact if I...
Jamesst20 Jamesst20
2

Laravel 5.7 : Unable to test Patch/Put/Delete routes

Hi, I currently have this in my routes/web.php : Route::middleware(['auth'])->group(function () { Route::resource('timesheets', 'TimesheetContr...
hardcoderrsl hardcoderrsl
10

Urgent help needed, even google couldn't answer- please help. Laravel test fails..

I'm using virtual test database for my testing. my API is working with postman. but creating problem when writing test. when I execute the test it shows a long list of erro...
Testing
10
157
Eddie212 Eddie212
6

Testing Laravel Socialite callback

I am pretty new to testing and, in particular, mocks. I have a controller (albeit incomplete) class RegistrationController extends Controller { public f...
Testing
6
137
bwrigley bwrigley
0

Caching issues during feature tests

I'm having an issue with what I think is caching during a feature test. The block of my test that I'm struggling with is: $subscriptionDetails = [...
ciarlill ciarlill
6

Problem testing Passport password grant

I am working on API authentication via Laravel Passport password grant based on this article:...
Testing
6
177
DawgOnKing DawgOnKing
2

Is this bad testing convention???

I just started writing tests and have zero experience. I'm literally learning and writing as Jeff puts out the videos. Anyway, I'm having little issues producing and...
adamkeen adamkeen
2

Test the Laravel socialite redirect

I've implemented Laravel socialite authentication and I'm trying to write a test to the login flow I have the two functions: redirectToProvider and...

Do you test all validations for create and update actions?

Hi! I'm writing tests for my new application and start to wonder... Do you test all form field validations for create and update actions seperately? To me it looks l...
lorvent lorvent
0

what testing tools/packages do you use?

Hello All, Lately i am thinking more and more of learning and using tests in projects to avoid bugs. i am using phpunit, dusk tests now but thinking of...
DawgOnKing DawgOnKing
7

Adding Factory to test POST

How can I refactor the below $attributes = [ 'sector' => 'CARGO', 'name' => strToUpper($this->faker->word) . ' AIRWAYS',...
Testing
7
100
Kenshirou Kenshirou
8

HttpException thrown after performing test

I'm having trouble to get it to pass the test at 5min video of Build a Laravel App with TDD. This is the code: use App\User; use App\Models\Project; ... /** @test...
troovers troovers
5

Continues integration using Codeship and Laravel Dusk

Hi guys, I started using Laravel Dusk to run browser tests for my project. I've written a few tests and made them all succeed on my local Homestead environment. Then...
Testing
5
101
vladistick vladistick
3

Laravel Passport and different database for testing.

Hello guys, I'm having terrible luck finding an anwser to my question anywhere so I thought I will ask on this forum. I'm trying to make some unit tests for API. I'm using...
Jacko Jacko
5

Passport - Personal Access Token Unit Test

Can someone help me to put up a unit test for personal access tokens? This test should validate, that Passport is setup correct and a new valid token can be created for a n...
Testing
5
239
treerz treerz
1

Laravel Dusk and Docker

I'm running a Laravel app inside of docker and trying to run browser tests. Since the app and the selenium are running inside of separate containers, I refer to the named c...
Create a New Discussion Button