ShaneTurner ShaneTurner
12

phpunit.xml not being read, using variables from .env

I can't get tests to run from a testing environment, they always seem to run using the 'local' variables set in the .env file rather than the settings in phpunit.xml...
Testing
12
795
BEIDevs BEIDevs
3

sqlite in-memory doesn't seem to be migrating DB before running tests

Laravel Version 5.2. PHP 7.0. I have a system that was setup to use MySQL with transactions for the test suite, but I hate that setup and I'm moving it to sqlite in...
Testing
3
155
ederson ederson
2

Running tests in a job uses wrong .env

For a project i need to fetch data using 3rd party apis. The problem is that those APIs cannot be trusted in the sense that can change the output or even stop working (stra...
Testing
2
108
mikail10000000 mikail10000000
4

Laravel 5.8 phpunit command issues

Hi, just installed fresh laravel 5.8 and the old vendor/bin/phpunit command does not work, I check the vendor/bin folder and the phpunit file is not there, wha...
Testing
4
107
shaikh709 shaikh709
1

Laravel Dusk not visiting Vue Route

I've a route like /employer/#/jobs when I try to use following code $browser->visit('/login')...
Surlica Surlica
4

Dusk type decimal with parseFloat in JS gives NaN

Using Dusk to test, I have the following javascript function attached to onchange/onblur events on an input field, to better format it into decimal: reformat...
Testing
4
136
hjortur17 hjortur17
3

Risky test

Hello, I'm new to testing and I'm following Jeffry's tutorial Let's Build A Forum with Laravel and TDD and I'm getting 1 risky test. Here is message from terminal:...
Testing
3
128
bwrigley bwrigley
13

Using Mockery, but original method still being called

I'm sure I'm missing something really obvious here as I have mocks with Mockery working elsewhere in my feature tests. This is what I have in a test currently:...
Testing
13
186

Mockery `->with(SomeModel)` returns fails

Hi, I have a test like that : $model = factory(SomeModel::class)->create()->fresh(); SomeService::shouldReceive('cancel')...
Testing
4
133
Surlica Surlica
4

Dusk loginAs results in 404

Trying to use loginAs results in 404 error. Screenshot shows login screen. $this->browse(function (Browser $browser) { $browser->loginAs(User::find...
Testing
4
137
AlexGodbehere AlexGodbehere
4

Is there a way to persist certain tables between tests?

I have a set of tables that hold information about things that will never change in my database such as country information. I'm currently re-seeding this data in set...
Testing
4
114
AlexGodbehere AlexGodbehere
8

Database does not exist when trying to use MySQL for PHPUnit tests

I have a MySQL database on my local machine that I use for development. Up to now, I've been using sqlite in-memory databases for my testing, but I want to test my suite ag...
Testing
8
162
ryanrapini ryanrapini
4

Writing route tests with proper feedback

Hey Guys! I've added simple route tests to my code to ensure that routes on my site are properly secured. All the route tests do is check to see that the status is r...
Testing
4
148
yoeriboven yoeriboven
3

Mocking class doesn't work

Trying to mock class Bar but it doesn't seem to work. Here's my code: // Routes.php Route::get('/', '[email protected]'); // HomeController....
Testing
3
149

Test Validation Email Unique fails always

The Request public function rules() { $id = (isset($this->id) ? $this->id : null) . ',id'; return [ 'firstName' =>...
Testing
8
136
joshbenham joshbenham
0

Feedback on DocumentMatch, PHPUnit, Mockery

Hey I would love to get some feedback on a Class I am creating called DocumentMatch (document=domain). A few points where I would love some feedback is:...
Mandrizzy Mandrizzy
0

Testing Laravel voyager with PHPunit

Ok so I'm writing some simple tests for laravel voyager but I can't seem to get the tests to pass even though i know it's working public function A_admin_can...
bwrigley bwrigley
0

'Risky' test

I have a feature test which is giving me this error: Test code or tested code did not (only) close its own output buffers I understand this can b...
MxFlix MxFlix
3

Dusk: Two tests not working together, but individually.

I have a Dusk test file with the following content: <?php namespace Tests\Browser; use Illuminate\Support\Facades\Auth; use Tests\Browser\Pages\Login; u...
Testing
3
282
amidknight amidknight
2

Laravel 5.8 Testing w/ Database Must Run One at a Time

Odd behavior that could be coming from the not doing it correctly place. I'm also not sure what all information would help keep this succinct yet cover the issue - updates...
Testing
2
105

Adding groups of assertions to tests

Hi Guys, I've been really playing with macro's and focusing a lot on adding different assertions to deal with specific groups of issues, like getting view data and l...
clemblanco clemblanco
7

Testing Model Observer Events - Laravel 5.6

I'm facing a weird issue today while trying to test a Model Observer Event. App\Providers\AppServiceProvider public...
Testing
7
189
fahad fahad
2

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
2
124
JonasWeigert JonasWeigert
13

Laravel 5 PHPUnit Memory Allocation Exhausted

I have a large testing suite for our API built in Laravel. We just moved our code to the latest build of Laravel (from a pre 5.0 version) to get ready for the 5.1 release a...
Testing
13
1239
suomato suomato
3

Testing Custom Artisan Command

Hello, I am working on a new Artisan command which help me(or you) to generate a new Vue component with boilerplate. Now the command works well and I would like to m...
Testing
3
269
Ashraam Ashraam
1

Testing file upload and resizing won't work

Hi everyone, I'm learning to develop using the TDD way and I'm facing this problem I can't solve. I'm uploading an image which is resized and store in databas...
Testing
1
112
matalina matalina
2

assertStatus giving errors

New to testing. But not exactly sure why I'm getting this error on the frist run, and then it passes on the other two (at least that's what I'm assuming) I have thr...
Testing
2
241
danielcoker danielcoker
4

Disable Exception Handling In Laravel Tests

I've been trying to disable exception handling in my test so I can see the errors, but it's not working even if I intentionally break the code. I'm just getting this...
Testing
4
246
DawgOnKing DawgOnKing
7

phpunit :: Laravel redirect upon validation failure

Please consider the following: //controller public function store() { $attributes = request()->validate([ 'name' => 'required',...
Testing
7
146
bwrigley bwrigley
4

How to test mail sent from Notification

My users can specify if they have Notifications sent to them instantly or to be notified daily of any pending Notifications. This all works fine with manual testing,...
Testing
4
176
nexxai nexxai
7

Unknown database ':memory:'

Am I missing something here? I've got my phpunit.xml set up correctly (I think): <env name="APP_ENV" value="testing"/> <env nam...
Testing
7
379
bwrigley bwrigley
8

Testing Notifications

I have set up my project so that a user can specify if they would like their notifications instantly, daily, weekly and via sms, email, or just in their dashboard. S...
Testing
8
156
DawgOnKing DawgOnKing
2

Assert Value is equal to Array Value

Given the following: $array = ['ONE', 'TWO', 'THREE']; $value = 'TWO' How do I assert the following: $this->assertEquals($...
Testing
2
104
lyleyboy lyleyboy
5

Dusk testing a < select > field just doesn't work

Hi folks, I'm hoping this is pretty straight forward but I'm using Dusk to test creating a new user (there are a few extra fields compared to the standard) On...
Testing
5
139
Jamesst20 Jamesst20
1

Kahlan v4 setup for Laravel 5.8

Hi, I would love to test my current application with the Kahlan testing framework :...
Testing
1
105
Create a New Discussion Button