Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
45 views

On laravel 11 / nova 4 app I use action class, which is called from user's view page : <?php namespace App\Nova\Actions\User; use App\Enums\UserBalanceActionTypeEnum; use App\Library\Facades\...
mstdmstd's user avatar
  • 3,321
0 votes
1 answer
84 views

I'm currently playing around with Laravel HTTP Feature Tests and I noticed when executing this code below: Test.php $this->actingUser($user) ->withHeaders([..]) ->post(uri: '/api/foo/bar', ...
afkka's user avatar
  • 3
0 votes
0 answers
24 views

In laravel 11 / livewire app I make test on a for with empty fields ? #[Test] public function on_new_article_got_validation_errors() { Livewire::test(ArticleEditor::class) ->set('...
mstdmstd's user avatar
  • 3,321
1 vote
0 answers
36 views

In laravel 11 / livewire app I make check if user has field status active like having middleware CheckAuthPermissionsMiddleware.php in bootstrap/app.php file and condition in this middleware : if ...
mstdmstd's user avatar
  • 3,321
0 votes
0 answers
218 views

I am adding a Pest test on Laravel 11 / Livewire 3 site I created a new test file with command : php artisan pest:test UsersTest But adding any code to check existing page I got 404 error, like in ...
Petro Gromovo's user avatar
0 votes
0 answers
62 views

I'm building an API with Laravel 10 and the JSON:API library. In this app, one of the main resources (Expense) has a to-one relationship with de User model. I decided to build this application ...
Franco Rule Calvi's user avatar
0 votes
1 answer
324 views

I'm running a unit test in Laravel in phpunit and encountering this error where my Collection macro seemingly does not exist: Method Illuminate\Support\Collection::getNext does not exist. The code ...
Unverified Contact's user avatar
2 votes
1 answer
303 views

I have a command and some methods related to Redis connection are running in it. I want to test some of these methods and for this I want to mock the Redis connection. I approached it like this: ...
cengsemihsahin's user avatar
0 votes
1 answer
73 views

On laravel site in controller I catch custom KeyIsNotProvidedException Exception: <?php try { $data = $this->method(); ... } catch (...
Petro Gromovo's user avatar
0 votes
1 answer
60 views

I'm currently working on a laravel package that has route configuration below Route::apiResource('companies', Controllers\CompanyController::class); Route::apiResource('companies.addresses', ...
Fery W's user avatar
  • 1,582
6 votes
1 answer
3k views

where running all test php artisan test everything work as expected and all tests runs now , when i run signle test php artisan test --filter test_get_profile i get this wired error An error occurred ...
d3ridi's user avatar
  • 301
1 vote
1 answer
777 views

I use a transformed Spatie/laravel-package-skeleton with my own ModuleServiceProvider and Module class for my system. I didn't find suffisant ressource on the web for making my module system so maybe ...
Alexis Van San's user avatar
1 vote
2 answers
1k views

For a Laravel Test of my Product API I am trying to check if the right number of prices are listed for all products. The API returns Json and the prices are items in the products.*.prices arrays. I am ...
St. Jan's user avatar
  • 206
1 vote
1 answer
463 views

I have been working on an issue with Laravel Dusk for a few hours and I cannot seem to find a solution. To start, I have a few tests written for the home page of my application. These tests all ...
Ana Nelson's user avatar
0 votes
1 answer
415 views

I have this code public function it_can_change_password() { DB::beginTransaction(); $payloadForUser = [ "name" => "Name", "...
Fil's user avatar
  • 8,911
0 votes
1 answer
796 views

I have added a Laravel package as local repository to my composer.json: ... "repositories": [{ "type": "path", "url": "../external-...
shaedrich's user avatar
  • 5,763
0 votes
1 answer
227 views

This is my feature test class CreateImageTest extends TestCase { private static function headers(){ .... } /** * @test * */ public function no_api_key_404() ...
Melly's user avatar
  • 755
0 votes
1 answer
204 views

I have a signup API that returns a JSON response in this kind of format { "meta": { //response metadata }, "data": { //user object } } I want to ...
Melly's user avatar
  • 755
0 votes
1 answer
132 views

Making tests on laravel 9 site I try to catch custom Exception and looking at this Undefind withoutExceptionHandling() example I do in my tests <?php namespace Tests\Feature; //use Illuminate\...
Petro Gromovo's user avatar
0 votes
0 answers
485 views

I'm using Auth:once() to authenticate users for a single request. if (!Auth::once($this->only('email', 'password'))) { RateLimiter::hit($this->throttleKey()); throw ValidationException::...
Bookie's user avatar
  • 1
0 votes
1 answer
213 views

I'm trying to test CRUD operations for my Lumen controllers. The constructor for each controller looks similar to this: private $loggedInUserId; public function __construct(Request $request) { ...
Wals's user avatar
  • 41
0 votes
0 answers
874 views

I have laravel project, which I'm using two database: relational PostgresSQL and MongoDB. I have to write feature tests to database but. I don't know how to create connection with mongo from laravel ...
ThePatrykOOO's user avatar
0 votes
0 answers
54 views

i run tests in my laravel project but the test files are inside a composer package, here is my section of phpunit.xml <testsuite name="Package Unit"> <directory suffix="Test....
Luca Becchetti's user avatar
0 votes
1 answer
769 views

I have a rating & review form which is used by the customers to submit their reviews. This form can be accessed using a url even if they are not signed-in to the platform. I use signed routes to ...
Murlidhar Fichadia's user avatar
0 votes
0 answers
147 views

I have a model that has a relationship with a View, that is complicate to popolate for make the feature test, but in the same time this is called from some component that are inside the controller ...
luca-rigutti's user avatar
1 vote
1 answer
997 views

In laravel 9, breeze 1.11 app I want to make feature test for forgot-password functionality and in routes I found : GET|HEAD In laravel 9, breeze 1.11 app I want to make feature test for ...
mstdmstd's user avatar
  • 3,321
4 votes
2 answers
2k views

Both php artisan test --parallel and php artisan test --exclude someGroup (this excludes tests which are annotated with someGroup) work, but php artisan test --parallel --exclude someGroup doesn't I ...
online Thomas's user avatar
1 vote
1 answer
57 views

In laravel 9.26.1 app I make tests with phpunit ^9.5.10 and I want to make checks on raised exceptions on login with invalid credentials In app/Http/Requests/Auth/LoginRequest.php I see : public ...
mstdmstd's user avatar
  • 3,321
2 votes
1 answer
743 views

I am trying to test the user registration, the test file came with laravel jetstream, I just added some additional fields, and I kept getting this error The user is not authenticated Failed asserting ...
Adam's user avatar
  • 105
-1 votes
2 answers
1k views

Making tests ("phpunit/phpunit": "^9.5.10") for laravel ("laravel/framework": "^9.2") site I want to use .env.testing file But I got error running command : $ ...
Petro Gromovo's user avatar
0 votes
1 answer
1k views

Hello im new to PHPUnit with minimum knowledge in laravel. Im trying to test this method that mass create student section public function setStudentsSection(Request $request) { $...
Kael's user avatar
  • 169
2 votes
2 answers
607 views

Given the following pest test: it('allows admins to create courses', function () { $admin = User::factory()->admin()->create(); actingAs($admin); $this->get('/courses')->...
Jazerix's user avatar
  • 4,828
1 vote
2 answers
2k views

In my application I have a response like this: { "items": [ { "id": 10, "field": "foo" }, { "id": 20, "...
Mistre83's user avatar
  • 2,817
-1 votes
1 answer
175 views

i dont know how to write mock test for my service here is my compressContract Interface interface compressContract { public function compress(); } here is my ZipCompress class <?php namespace ...
Abbas's user avatar
  • 137
1 vote
2 answers
688 views

Trying to install dusk on Laravel like this: php7.4 artisan dusk:install I get this error: Dusk scaffolding installed successfully. Downloading ChromeDriver binaries... ErrorException ...
iateadonut's user avatar
  • 2,278
0 votes
1 answer
429 views

The Illuminate\Testing\TestResponse::assertSessionHasNoErrors() isn't working as I would expect it to. I have something like this in my code: $response = $this->post('account/project/create', $...
iateadonut's user avatar
  • 2,278
0 votes
1 answer
501 views

How can we assert some of the array's property values which contain the expected object values? My code below is working okay, but it checks all array property values. I want to ask if there's a way ...
アリ・ナディム's user avatar
1 vote
0 answers
130 views

I'm newbie on testing so I want to create a auth testing but in project I don't use laravel Models but I'm using own methods for auth because of started project too long ago. TestCase class has ...
Mehmet KÖSMEN's user avatar
3 votes
1 answer
9k views

When I check dd(\Auth()::check()); in testLoginTrue method in LoginTest case then it's returning true but when I use dd(\Auth()::check()); in testClientCreateFormDisplayed method in ClientTest then it'...
Hardik Patel's user avatar
-1 votes
2 answers
935 views

I'm using laravel7 and codeception; and I have an Api test class called abcCest located inside test/api folder. it looks like this: <?php use Tests\TestCase; class abcCest extends TestCase {} ...
Alladin's user avatar
  • 1,072
1 vote
2 answers
1k views

I'm looking for solution to test an array of objects with PHPUnit in my Laravel project. This is my haystack array: [ [ "id" => 10, "name" => "Ten&...
netdjw's user avatar
  • 6,121
0 votes
1 answer
568 views

I created a trait sets up some Global Scopes based on the query parameters. It does that by reading from the request() helper and reading the query parameters from the url. Below is the start of the ...
Gijs Beijer's user avatar
1 vote
1 answer
338 views

according laravel-database-testing I have a factory relationship for testing data, my code like this public function test_users_can_authenticate_using_the_login_screen() { $this->seed(...
baralogi's user avatar
1 vote
1 answer
295 views

so as I stated in the title, I am working on Laravel 5.7 project and am making first tests in this application (big system). We did not make any tests in here yet, so this problem is the first time ...
Lukas Grofcik's user avatar
0 votes
1 answer
883 views

Our Laravel app uses PostgreSQL and before we insert a register in a table we reserve the next valid id by calling PostgreSQL nextval function. I want to test the insert method of UserRepository. As ...
assensi's user avatar
  • 360
0 votes
3 answers
3k views

I'm trying to run a single test where multiple users are performing actions. There is either a bug in the actingAs() function, or I am completely missing something trivial. So here's the scenario. I ...
eResourcesInc's user avatar
0 votes
2 answers
1k views

I need to make some fake records in laravel testing in a way that some of them have specific values. for example I need to create 20 fake records of countries name and want to name the two records &...
rahman j89's user avatar
1 vote
0 answers
110 views

it´s my first time that I´m doing the unitary test in PHP and laravel and I have this problem: Tests\Vocces\Company\Routes\CreateNewCompanyRouteTest > post create new company route Expected ...
scorpions78's user avatar
0 votes
1 answer
37 views

public function test_case1() { $user = factory(User::class)->create([ 'fname' => "Testing", 'lname' => 'bot', 'email' => "testing_bot@apimio....
Hashir Butt's user avatar
1 vote
1 answer
1k views

I'm using Laravel Dusk to test all links on a page, these links are PDF files that are that are copied from resources/docs to public/docs with laravel mix. The problem is that trying to access the URL ...
hereForLearing's user avatar