Skip to main content
2 votes
1 answer
76 views

I am doing some unit testing with PHP. I got stuck on an error that the fluent interface of PHPUnit requires an intermediate variable. What is the reason for this behavior? See MyTests::works vs. ...
Sven Eppler's user avatar
  • 1,796
1 vote
2 answers
148 views

I have a problem which I find awfully hard to debug: In my application, I currently have about 1000 tests, so not much. They are split across several directories (tests/someDir, tests/someOtherDir, ...
PhilippG's user avatar
0 votes
1 answer
92 views

I can't seem to find a definitive answer on how to test the following boot methods using PHPUnit tests in Laravel. I'm referring to the mthods in public static function boot() on a model. Survey model ...
Daniel Harper's user avatar
0 votes
0 answers
129 views

In my Laravel application, I have set up two databases in a single server. All specific migrations and model classes have $connection property set up to use blog instance. The app works fine, no ...
Gasimoff's user avatar
1 vote
0 answers
45 views

I have PHPUnit tests that use data providers as inputs, and by default these are outputted in a diff-like format (when running with php artisan test): 1) Tests\Feature\MyTest::test_feature with data ...
Hashim Aziz's user avatar
  • 6,577
2 votes
1 answer
53 views

I have following server variable in phpunit.xml: <php> <server name="APP_DEBUG" value="false"/> </php> Sometimes while developing, I want have APP_DEBUG ...
Justinas's user avatar
  • 43.9k
0 votes
0 answers
98 views

I'm currently building a multi-tenant application using stancl/tenancy (every tenant uses their own database) in my Laravel application. Whenever I'm writing tests, tests fail a lot due to the error ...
FryingPan's user avatar
  • 123
1 vote
0 answers
192 views

I have a contrived test case showcasing how multiple test cases can slow the entire execution time down, as even though each is quick on its own, they add up if waited for before executing the next. I ...
k0pernikus's user avatar
  • 67.6k
1 vote
1 answer
61 views

I'm trying to set up testing for a Wordpress child theme. I've use the wp-cliwp scaffold theme-tests command to scaffold some tests. Inside of my child theme's functions.php file, I load some ...
jloosli's user avatar
  • 2,595
1 vote
0 answers
65 views

I have a bit of trouble figuring out of how to test import book route of my controller in PHPUnit Testing. I'm Using MaatWebsite Package for the excel. So, I have real excel file in test/Files/...
Kholid Syaifullah's user avatar
0 votes
1 answer
41 views

I want to test MarkAsRead function via routing, my route was Route::post('notifications/{id}', [NotificationController::class, 'markAsRead']); and it was in API routing of auth:sanctum api route Route:...
TheBetweener's user avatar
3 votes
1 answer
147 views

I have API for books that I want to test using phpunit, but the structure of nested json somehow make index and show test function making one of them fail. If I wrote this code for both index and show ...
TheBetweener's user avatar
2 votes
2 answers
61 views

I have a piece of code that does the following: Create a database row (spatie media library) Create a job that adds something to column A and saves the object (also spatie media library) Adds ...
Veda's user avatar
  • 2,113
0 votes
1 answer
54 views

PHPUnit test suites not showing in Test Explorer, despite correct configuration in VS-Code it looks like this: TESTING [Filters fiel] 6/6 (6 from 6 succesful) └─ {} SL5 └─ PregContentFinder └─ {} ...
SL5net's user avatar
  • 2,630
0 votes
2 answers
63 views

I am setting up a golden master test case, yet the result may be off at certain points due to side-effects changing some strings at known places. Getting rid of those side-effects would be best, yet ...
k0pernikus's user avatar
  • 67.6k

15 30 50 per page
1
2 3 4 5
673