wopi-test-bundle is a testing-specific companion to wopi-bundle, which enables WOPI (Web Application Open Platform Interface) integration for Laravel. If your product relies on WOPI for document collaboration (e.g., Office Online integration with Nextcloud, OnlyOffice, or Microsoft 365), this bundle could streamline unit/integration testing of WOPI endpoints.champs-libres/wopi-bundle (v1.x+) as a dependency.mockery or similar for request/response mocking.wopi-bundle version (e.g., breaking changes in v2.x).wopi-bundle is already integrated, this is a drop-in test utility.check_file_info, get_file, put_relative)?wopi-bundle config that need mocked responses?Http::fake(), Mockery) achieve similar results with less overhead?champs-libres/wopi-bundle (required).createApplication()).Mockery, Laravel Mocks).wopi-bundle if not already present:
composer require champs-libres/wopi-bundle
config/wopi.php.composer require --dev champs-libres/wopi-test-bundle
php artisan vendor:publish --provider="ChampsLibres\WOPI\TestBundle\WOPITestBundle"
TestCase or create a custom WOPITestCase:
use ChampsLibres\WOPI\TestBundle\WOPITestTrait;
class MyWOPITest extends TestCase {
use WOPITestTrait;
public function testCheckFileInfo() {
$response = $this->wopi('check_file_info', [
'access_token' => '...',
// ... other params
]);
$response->assertSuccessful();
}
}
wopi.php matches the bundle’s expectations (e.g., wopi.storage class).Http client; ensure no conflicts with custom clients.wopi-bundle into production.wopi-test-bundle to composer.json (dev-only).wopi-bundle versions.dd() or Xdebug for WOPI request/response inspection.wopi-bundle logs for integration errors.Http::fake().phpunit.xml:
<group name="wopi" file="tests/WOPITest.php"/>
| Failure Type | Likelihood | Mitigation |
|---|---|---|
| Bundle incompatibility | Medium | Pin versions in composer.json. |
| Missing test coverage | High | Supplement with manual WOPI tests. |
| Mock behavior bugs | Low | Review test outputs for edge cases. |
| CI test flakiness | Medium | Isolate WOPI tests from other suites. |
wopi-bundle internals.How can I help you explore Laravel packages today?