Download the PHP package sti3bas/laravel-scout-array-driver without Composer
On this page you can find all versions of the php package sti3bas/laravel-scout-array-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-scout-array-driver
Array driver for Laravel Scout
This package adds an array
driver to Laravel Scout and provides custom PHPUnit assertions to make testing search related functionality easier.
Contents
- Installation
- Usage
- License
Installation
Install the package via Composer:
Set Scout driver to array
in .env.testing
file:
or in phpunit.xml
file:
Usage
The Search
facade provides the following methods and assertions:
assertContains($model, $callback = null)
Checks if model exists in the search index.
assertNotContains($model, $callback = null)
Checks if model doesn't exist in the search index.
assertContainsIn($index, $model, $callback = null)
Checks if model exists in custom search index.
assertNotContainsIn($index, $model, $callback = null)
Checks if model doesn't exist in custom search index.
assertEmpty()
Checks if all search indexes are empty.
assertEmptyIn($index)
Checks if search index is empty.
assertNotEmpty()
Checks if there is at least one record in any of search indexes.
assertNotEmptyIn($index)
Checks if search index is not empty.
assertCount($count)
Checks if there is at least one record in any of search indexes.
assertCountIn($index)
Checks if search index is not empty.
assertSynced($model, $callback = null)
Checks if model was synced to search index. This assertion checks every record of the given model which was synced during the request.
assertNotSynced($model, $callback = null)
Checks if model wasn't synced to search index. This assertion checks every record of the given model which was synced during the request.
assertSyncedTo($model, $callback = null)
Checks if model was synced to custom search index. This assertion checks every record of the given model which was synced during the request.
assertNotSyncedTo($model, $callback = null)
Checks if model wasn't synced to custom search index. This assertion checks every record of the given model which was synced during the request.
assertSyncedTimes($model, $callback = null)
Checks if model was synced expected number of times. This assertion checks every record of the given model which was synced during the request.
assertSyncedTimesTo($index, $model, $callback = null)
Checks if model was synced to custom search index expected number of times. This assertion checks every record of the given model which was synced during the request.
assertNothingSynced()
Checks if nothing was synced to any of search indexes. This assertion checks every record which was synced during the request.
assertNothingSyncedTo()
Checks if nothing was synced to custom search index. This assertion checks every record which was synced during the request.
assertIndexExists($index)
Checks if search index exists.
assertIndexNotExists($index)
Checks if search index doesn't exist.
fakeRecord($model, $data, $merge = true, $index = null)
This method allows to fake search index record of the model. It will not affect assertions.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-scout-array-driver with dependencies
illuminate/bus Version ^9.0 || ^10.0 || ^11.0
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0
illuminate/database Version ^9.0 || ^10.0 || ^11.0
illuminate/http Version ^9.0 || ^10.0 || ^11.0
illuminate/pagination Version ^9.0 || ^10.0 || ^11.0
illuminate/queue Version ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^9.0 || ^10.0 || ^11.0
laravel/scout Version ^10.0