$result->setAttribute('type', $result->getType());
$result->setAttribute('url', $result->getUrl());
$result->setAttribute('preview_html', [
- 'name' => (string) $result->getAttribute('preview_name'),
+ 'name' => (string) $result->getAttribute('preview_name'),
'content' => (string) $result->getAttribute('preview_content'),
]);
}
public function forSelect(Request $request)
{
$hasPermission = signedInUser() && (
- userCan('users-manage')
+ userCan('users-manage')
|| userCan('restrictions-manage-own')
|| userCan('restrictions-manage-all')
);
$resp = $this->actingAsApiAdmin()->getJson($this->baseEndpoint . '?query=superuniquevalue');
$resp->assertJsonFragment([
'type' => 'page',
- 'url' => $page->getUrl(),
+ 'url' => $page->getUrl(),
]);
}
$resp = $this->actingAsApiAdmin()->getJson($this->baseEndpoint . '?query=superuniquevalue');
$resp->assertJsonFragment([
- 'type' => 'book',
- 'url' => $book->getUrl(),
+ 'type' => 'book',
+ 'url' => $book->getUrl(),
'preview_html' => [
- 'name' => 'name with <strong>superuniquevalue</strong> within',
+ 'name' => 'name with <strong>superuniquevalue</strong> within',
'content' => 'Description with <strong>superuniquevalue</strong> within',
- ]
+ ],
]);
}
class UserSearchTest extends TestCase
{
-
public function test_select_search_matches_by_name()
{
$viewer = $this->getViewer();
$resp = $this->get('/search/users/select?search=a');
$this->assertPermissionError($resp);
}
-
-}
\ No newline at end of file
+}