404labfr/laravel-impersonate

Route::impersonate() breaks phpunit tests.

WoodyNaDobhar opened this issue · 0 comments

With the Route defined, I get the following error trying to run phpunit tests:

In Router.php line 1269:

  Undefined offset: 0

When I comment out the route, the tests run as expected.

I'm not sure what other info you need to test this, but here's my composer.json:

{
	"name" : "laravel/laravel",
	"type" : "project",
	"description" : "The Laravel Framework.",
	"keywords" : [
		"framework",
		"laravel"
	],
	"license" : "MIT",
	"require" : {
		"php" : "^7.2.5",
		"anhskohbo/no-captcha" : "^3.3",
		"arcanedev/log-viewer" : "^7.0",
		"arielmejiadev/larapex-charts" : "^1.0",
		"cohensive/embed" : "^5.5",
		"deployer/deployer" : "^6.8",
		"deployer/recipes" : "^6.2",
		"doctrine/dbal" : "~2.3",
		"fideloper/proxy" : "^4.4",
		"fruitcake/laravel-cors" : "^1.0",
		"genealabs/laravel-pivot-events" : "*",
		"guzzlehttp/guzzle" : "^6.3",
		"infyomlabs/adminlte-templates" : "7.0.x-dev",
		"infyomlabs/laravel-generator" : "7.0.x-dev",
		"intervention/image" : "^2.5",
		"lab404/laravel-impersonate" : "^1.7",
		"laravel/framework" : "^7.0",
		"laravel/tinker" : "^2.4",
		"laravel/ui" : "^2.0",
		"laravelcollective/html" : "^6.2",
		"niklasravnsborg/laravel-pdf" : "^4.0",
		"nztim/mailchimp" : "^3.11",
		"owen-it/laravel-auditing" : "^11.0",
		"ps/image-optimizer" : "^2.0",
		"stripe/stripe-php" : "^7.61",
		"vemcogroup/laravel-sparkpost-driver" : "^4.0",
		"webdevetc/blogetc" : "^8.4",
		"wildside/userstamps" : "^2.1",
		"woodynadobhar/laravel-stupid-password" : "^1.0",
		"yajra/laravel-datatables-buttons" : "^4.10",
		"yajra/laravel-datatables-html" : "^4.32",
		"yajra/laravel-datatables-oracle" : "~9.0"
	},
	"require-dev" : {
		"barryvdh/laravel-ide-helper" : "^2.8",
		"darkaonline/l5-swagger" : "7.*",
		"facade/ignition" : "^2.0",
		"filp/whoops" : "^2.9",
		"fzaninotto/faker" : "^1.9",
		"laravel/homestead" : "^11.3",
		"mockery/mockery" : "^1.4",
		"nunomaduro/collision" : "^5.1",
		"phpunit/phpunit" : "^8.5",
		"stechstudio/laravel-ssh-tunnel" : "^3.0"
	},
	"config" : {
		"optimize-autoloader" : true,
		"preferred-install" : "dist",
		"sort-packages" : true
	},
	"autoload" : {
		"psr-4" : {
			"App\\" : "app/"
		},
		"files" : [
			"app/helpers.php"
		],
		"classmap" : [
			"database/seeds",
			"database/factories"
		]
	},
	"autoload-dev" : {
		"psr-4" : {
			"Tests\\" : "tests/"
		}
	},
	"minimum-stability" : "dev",
	"prefer-stable" : true,
	"scripts" : {
		"post-autoload-dump" : [
			"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
			"@php artisan package:discover --ansi"
		],
		"post-root-package-install" : "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
		"post-create-project-cmd" : "@php artisan key:generate --ansi",
		"post-update-cmd" : [
			"Illuminate\\Foundation\\ComposerScripts::postUpdate",
			"@php artisan ide-helper:generate",
			"@php artisan ide-helper:meta"
		]
	}
}

I've attempted various configurations of the middleware, including taking it out of the existing custom 'subdomain.protection' middleware group, both with and without the 'web' middleware, and with the web middleware inside the 'subdomain.protection' middleware group. Commenting it out is the only solution I've found that works.