InteractsWithTypesense
trait InteractsWithTypesense
Add Typesense support to an integration test.
Use this trait on a test case and set TYPESENSE_HOST and TYPESENSE_API_KEY. TYPESENSE_PORT and TYPESENSE_PROTOCOL may also be configured. Test collections are isolated and cleaned up using a TEST_TOKEN-based prefix.
Properties
| protected string | $typesenseTestPrefix | The test prefix for collection isolation. |
|
| protected Client|null | $typesense | The Typesense client instance. |
Methods
Set up Typesense for testing (auto-called by setUpTraits).
Tear down Typesense (auto-called via beforeApplicationDestroyed).
Initialize the Typesense client.
Get Typesense client settings.
Compute the test prefix for parallel-safe collection names.
Clean up all test collections matching the test prefix.
Details
at line 35
protected void
setUpInteractsWithTypesense()
Set up Typesense for testing (auto-called by setUpTraits).
Typesense integration tests are opt-in via TYPESENSE_HOST. Port, protocol, and API key settings are only read after TYPESENSE_HOST is present.
at line 55
protected void
tearDownInteractsWithTypesense()
Tear down Typesense (auto-called via beforeApplicationDestroyed).
at line 73
protected void
initializeTypesenseClient()
Initialize the Typesense client.
at line 83
protected array
getTypesenseClientSettings()
Get Typesense client settings.
at line 101
protected void
computeTypesenseTestPrefix()
Compute the test prefix for parallel-safe collection names.
at line 112
protected void
cleanupTypesenseCollections()
Clean up all test collections matching the test prefix.