miggi miggi
0

How to navigate through javascript tests file in sublime text

Hi, guys! With php tests we can hit Ctrl + R in sublime text to see all methods in file, I can't do the same with my js tests cause all test names are strings. But I need t...
pilat pilat
7

Feature tests do not work (404)

Hi, I'm having this little (I'm sure) problem with testing, but I seem to be stuck as I don't know how to troubleshoot it further. There just seem to be not enough info…...
drewdan drewdan
2

Test starts before seeding finishes

Hey Guys, How does seeding in tests work? protected function setUp() { parent::setUp(); $this->artisan('migrate'); (new \Da...
chrisblackwell chrisblackwell
2

Testing Gate Policies

Does anyone know how to test a GatePolicy directly? For example, I want to test that my UserPolicy works a certain way given permissions. I don't want to have to hit...
canadianlover canadianlover
5

SQLite - unique constraint failed

I have a test in my aqpplication. I have the following model factory: use App\Hand; /* |----------------------------------------...
etrainerspy etrainerspy
13

Getting an error on the command: php artisan migrate

This is the message that I am getting: [Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.t...
Testing
13
1944
ctyler ctyler
1

Telescope not logging Registered Event

So I am using Telescope for testing and troubleshooting. When a person registers they are to select an employer form a drop down. The employer is to get an email so...
untymage untymage
3

Why are my tests is slower than Jeffrey's tests?

OS : Windows 10 Hardware: i7 - 6700k, SSD 850 EVO - 16Gig RAM ENV : Vagrant / PHPStorm Hello everyone, I'm just wondering at why my tests are slow? Despite the fact...
Testing
3
102
supertrall supertrall
14

Laravel ignores the testing connection

I have a big and complex mysql-based schema and I want to use an in-memory sqlite database for testing using migrations for cleaning up as it's said here:...
Testing
14
811
keizah keizah
5

Laravel table seeding using model factory

I'm trying to seed my table with fake data and the problem is when I'm trying to get data from the collection or using method. Returned data is always the same. Why I am n...
hjortur17 hjortur17
1

Expected status code 422 but received 500

Hi, any ideas why I'm getting this error message? I can't figure it out. What files do you need to see...
mohammadkaab mohammadkaab
0

Laravel dusk can't run two tests referring to one page

Hi I'm writing a couple of tests with LARAVEL dusk and I've recently dumped to a new problem. well, the problem is very famous and everyone has seen it for once at least Ac...
jacquet-clement jacquet-clement
0

Dusk testing vs. Vue unit tests

Hello everybody, I'm struggling finding the best way to test my vue SPA. I've tried using Jest & vue-test-utils to unit test my components / routes / guar...
hjortur17 hjortur17
4

Expected status code 200 but received 201.

I can't figure out why I'm receiving 201 instead of 200. Here is the test and the controller public function users_may_only_reply_a_maximum_of_once_per_minut...
hjortur17 hjortur17
12

Session is missing expected key [errors]. Failed asserting that false is true.

Hi, I can't figure out how to get this to green. I get this error message when running this method ERROR: Session is missing expected key [errors]. Fa...
Testing
12
139
Wuanshu Wuanshu
10

A facade root has not been set

Hi everyone. I am trying to run some tests on my Laravel application but I'm stuck. When I run the command ./vendor/bin/phpunit --coverage-html public/tests I...
Testing
10
79
tomix tomix
4

Unit Tests returning error in laravel 5.5

I have problem, because in my aplikattion i gets such error Cannot open file "ExaTest.php". My command is ./vendor/bin/phpunit tests/ExaTest.php My...
Lars-Janssen Lars-Janssen
9

phpunit use right database

hey, I'm testing an api function with the following code: factory(Company::class,1) ->create(['CompanyId' =&...
Testing
9
479
Cairn Cairn
3

Laravel 5.5 Missing assertions

I'm trying to make a simple test where I request the login page and assert that is the page I've loaded. However it seems laravel can't find the assertViewIs() method. It's...
LuisGC LuisGC
2

Im very new testing with laravel

just done this to test an URL public function testCalendarURL() { $response = $this->actingAs(User::find(1))->get('bitacore/1');...
meijdenmedia meijdenmedia
3

Unit Test "deep" relational data

Dear community, In Laravel it is very normal to get data from related objects like $customer->wallet->balance. What is the best approach in testin...
Grimmys Grimmys
0

[DUSK] Use a pattern instead of a string to match the URL

Hello, It seems that assertPathIs takes only a string as an argument. However, I would like to verify if the URL follows this pattern : " my...
drewdan drewdan
2

SQLite in Memory for PHPUnit Testing

Hi All, I am working on optimising our unit tests, we are currently using a MySQL database to run our tests, and it takes quite a great deal of time and we only have...
hjortur17 hjortur17
16

Failed asserting that actual size 0 matches expected size 1.

Hi, I'm trying to figure out why this is happening in my test. So I'm trying to use Laravel Notifications and I'm testing it but I get this error: Failed asser...
Testing
16
172
Oldenborg Oldenborg
9

Testing if email was sent with out sending it

Im writing an acceptance test to check if the built in "reset password" functionality is working properly. How do I test if the mail is being triggered and sent w...
Testing
9
1686
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
2400
nztim nztim
3

Seeding the database for all tests (5.5)

I'm trying out the new RefreshDatabase trait with a test class where I want to have a default user in the database for each test without having to run factory() in every me...
Testing
3
427
stomaskov stomaskov
3

Proper way to write integration test for Laravel package

So, I need to test Laravel package API endpoints. I'm using Testbench. Sounded simple enough. Run migrations, seed and make a request. BUT, this package depends on f...
Testing
3
113
hariprasanth hariprasanth
1

Laravel cache issue in 5.8

I am getting more cache issue while running laravel project each time i have to use cache:clear and view:clear for this issue there is any other solution to fix this cache...
thc1967 thc1967
3

Testing and Apostrophe Characters in Fields

I get tests that fail every so often because of the way the system, not sure what part, handles apostrophes. When I use $faker->name, I often get som...
Testing
3
295
pulkit pulkit
8

Model Factories relationship dependencies

Just migrating from Laravel 4.2 to 5.1, and setting up the model factories. In the 4.2 version I uses to use the laracasts/testdummy package which offered simi...
Testing
8
408
mohammadkaab mohammadkaab
2

Attach a new class to an interface in Testing

Hi everyone Actually I'm binding a new concrete class to an interface in one of my test classes so this way stoping the app of calling the real classes but what I'm...
kolmogorov kolmogorov
3

Faker - providers added at each factory call

Say I have a simple factory for a Person model, for example: $factory->define(\App\Models\People::class, function (Faker\Generator $faker) { $faker-&g...
dk4210 dk4210
27

Invoking the Artisan Dusk command outside the CLI

Hello Guys, I can't seem to figure out how to run the Artisan Dusk Command via route. I have the following but doesn't work Route::get('/logint...
Testing
27
380
rudexpunx rudexpunx
11

RefreshDatabase trait doesn't refresh database

From the doc.: ###Resetting The Database After Each Test It is often useful to reset your database after each test so that data from a previous test does not interfe...
Testing
11
1540
Create a New Discussion Button