this slice is a array ['HTTP_REFERER' => route('settings.preferences')] he's trying convert the whole array to string, not sure what your test does
Sep 17, 2019
5
Level 11
Array to string conversion Feature Test
/**
* Add. test pass
*
* @test
* @group feature
* @group feature:setting
* @group settings.index
* @return void
*/
public function a_user_can_save_preferred_date_format()
{
// Arrangements
$this->withoutExceptionHandling();
$this->actingAs($user = $this->asNonSuperAdmin(['settings.store', 'settings.preferences']));
$this->withPermissionsPolicy();
// Actions
$attributes = [ 'format:date' => [
'key' => 'format:date',
'value' => settings('format:date')
]];
$response = $this->post(
route('settings.store'), $attributes,
['HTTP_REFERER' => route('settings.preferences')]
);
// Assertions
$response->assertRedirect(route('settings.preferences'));
$this->assertDatabaseHas($this->service->getTable(), $attributes);
}
I'm not sure on this line
$response = $this->post(
route('settings.store'), $attributes,
['HTTP_REFERER' => route('settings.preferences')]
);
I got an error that says ErrorException: Array to string conversion what could be wrong? can someone have an idea thanks
Please or to participate in this conversation.