| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This module allows you to write functional tests for gRPC services using Codeception. It provides tools for sending gRPC requests and asserting responses, which helps ensure your gRPC services behave as expected.
composer require --dev mercer_morning/codeception-grpc-moduleAdd the module to your suite configuration file (e.g., tests/functional.suite.yml):
modules:
enabled:
- Codeception\Module\GrpcHere’s an example of how to use the module in a test:
<?php
use App\Grpc\CalendarService;
use App\Tests\Fixtures\CalendarFixture;
use Codeception\Example;
use YourNamespace\Proto\GetEmployeesWithWorkingDaysInRangeRequest;
use YourNamespace\Proto\GetEmployeesWithWorkingDaysInRangeResponse;
$request = new GetEmployeesWithWorkingDaysInRangeRequest();
$request->setBranchUuid('d43040e0-96ea-4d9f-9fc9-020ee933536b');
/** @var GetEmployeesWithWorkingDaysInRangeResponse $res */
$res = $I->doGrpcRequest(
$I->grabService(CalendarService::class),
'GetEmployeesWithWorkingDaysInRange',
$request
);
$uuids = [];
foreach ($res->getUuids() as $uuid) {
$uuids[] = $uuid;
}
$I->assertEquals([
"dbf4de2e-c342-4c52-b95d-ecd8f7a492f1",
"dbf4de2e-c342-4c52-b95d-ecd8f7a492f2"
], $uuids);Sends a gRPC request to the specified service using the given method and request object. Returns the response object.
| Back | FazBrowse Home | New Git URL |