rybakit/phpunit-extras with Tarantool-specific annotations (e.g., @lua, @sql, @requires TarantoolVersion), reducing boilerplate for common test scenarios.TestDoubleClient, RequestExpectations) and base classes (TestCase), allowing incremental adoption. Tests can extend Tarantool\PhpUnit\TestCase or mix in specific traits for targeted functionality.TestCase or registering the AnnotationExtension in phpunit.xml. Configuration supports DSN strings or environment variables, easing CI/CD integration.tarantool/php (client library) and phpunit (v9+). Composer dev dependencies include ext-msgpack, which is critical for Tarantool’s binary protocol. Check for version conflicts with existing tarantool/php usage (package targets tarantool/php v0.10+).@requires Tarantool ^2.3.2) may break if your Tarantool server upgrades. Test thoroughly with your target versions.TestDoubleClient simplifies mocking, advanced scenarios (e.g., custom error responses) require familiarity with the builder pattern. Document edge cases in your test suite.@lua, @sql, etc., may outweigh benefits.@lua/@sql annotations (unless using mocks). Version constraints must align with your server.composer require --dev tarantool/phpunit-extras
Tarantool\PhpUnit\TestCase or add the AnnotationExtension to phpunit.xml.@sql for schema initialization).TestDoubleClient for isolated tests.RequestExpectations to validate interaction counts (e.g., expectSelectRequestToBeCalledOnce()).PreparedStatementExpectations) for complex assertions.phpunit.xml using DSN or environment variables:
<extension class="Tarantool\PhpUnit\Annotation\AnnotationExtension">
<arguments>
<string>tcp://%env(TARANTOOL_HOST)%:%env(TARANTOOL_PORT)%</string>
</arguments>
</extension>
TARANTOOL_HOST) in your CI/CD pipeline.phpunit/phpunit constraints).tarantool/php v0.10+. Verify your project’s dependency graph for conflicts.ext-msgpack (for binary protocol). Add to composer.json dev requirements if missing:
"require-dev": {
"ext-msgpack": "*"
}
@sql require Tarantool 2.0+. Validate server compatibility.composer install).phpunit.xml or phpunit.neon).TestDoubleClient) for tests that don’t need a real Tarantool instance.@lua, @sql) for tests requiring server interactions.expectSelectRequestToBeCalledOnce()).TESTING.md section explaining Tarantool-specific test patterns.@requires Tarantool ^2.3.2) and their implications.rybakit/phpunit-extras (this package’s base). Subscribe to its release notes.@sql stops working with Tarantool 3.0, you may need to extend the package or write custom logic.// Before (manual)
public function setUp(): void {
$this->client->execute('CREATE TABLE test (id INT)')->wait();
}
// After (annotation)
/**
* @sql CREATE TABLE test (id INT)
*/
public function testTableCreation() { ... }
@lua fails silently, check the Tarantool server logs for Lua errors.@lua/@sql before every test can slow down suites. Mitigate by:
TestDoubleClient) for non-critical tests.@sql for schema once per class).TestDoubleClient is lightweight but may not scale for high-volume request validation. Consider customHow can I help you explore Laravel packages today?