Skip to content

Instantly share code, notes, and snippets.

@G3z
Created December 16, 2021 11:02
Show Gist options
  • Save G3z/fa3e5d476e23dd4b495c92e51f66c259 to your computer and use it in GitHub Desktop.
Save G3z/fa3e5d476e23dd4b495c92e51f66c259 to your computer and use it in GitHub Desktop.
<?php
class RelationsTest extends TestFeatureCase
{
public function testSearchColumnsWithScope()
{
$user = $this->users->random();
$params = [
'search' => $user->email,
'model' => Crypt::encryptString(EmptyUserModel::class),
'name' => Crypt::encryptString('name'),
'key' => Crypt::encryptString('id'),
'searchColumns' => Crypt::encrypt(['email', 'name']),
'scope' => Crypt::encrypt([
'name' => 'asFilerId',
'parameters' => [$user->id],
]),
'append' => Crypt::encryptString('full'),
];
$response = $this
->actingAs($this->createAdminUser())
->post(route('platform.systems.relation'), $params);
$response->assertJson([
$user->id => $user->name.' ('.$user->email.')',
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment