|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * This file is part of Temporal package. |
| 5 | + * |
| 6 | + * For the full copyright and license information, please view the LICENSE |
| 7 | + * file that was distributed with this source code. |
| 8 | + */ |
| 9 | + |
| 10 | +declare(strict_types=1); |
| 11 | + |
| 12 | +namespace Temporal\Tests\Unit\Interceptor; |
| 13 | + |
| 14 | +use PHPUnit\Framework\Attributes\DataProvider; |
| 15 | +use Temporal\DataConverter\DataConverter; |
| 16 | +use Temporal\DataConverter\DataConverterInterface; |
| 17 | +use Temporal\Interceptor\ActivityInboundInterceptor; |
| 18 | +use Temporal\Interceptor\Header; |
| 19 | +use Temporal\Interceptor\Trait\ActivityInboundInterceptorTrait; |
| 20 | +use Temporal\Interceptor\Trait\WorkflowClientCallsInterceptorTrait; |
| 21 | +use Temporal\Interceptor\Trait\WorkflowInboundCallsInterceptorTrait; |
| 22 | +use Temporal\Interceptor\Trait\WorkflowOutboundCallsInterceptorTrait; |
| 23 | +use Temporal\Interceptor\Trait\WorkflowOutboundRequestInterceptorTrait; |
| 24 | +use Temporal\Interceptor\WorkflowClientCallsInterceptor; |
| 25 | +use Temporal\Interceptor\WorkflowInboundCallsInterceptor; |
| 26 | +use Temporal\Interceptor\WorkflowOutboundCallsInterceptor; |
| 27 | +use Temporal\Interceptor\WorkflowOutboundRequestInterceptor; |
| 28 | +use Temporal\Tests\Unit\AbstractUnit; |
| 29 | + |
| 30 | +/** |
| 31 | + * Check that interceptor traits cover all interfaces methods. |
| 32 | + * |
| 33 | + * @group unit |
| 34 | + * @group interceptor |
| 35 | + */ |
| 36 | +class TraitsTestCase extends AbstractUnit |
| 37 | +{ |
| 38 | + public function testActivityInboundInterceptor(): void |
| 39 | + { |
| 40 | + new class implements ActivityInboundInterceptor { |
| 41 | + use ActivityInboundInterceptorTrait; |
| 42 | + }; |
| 43 | + |
| 44 | + self::assertTrue(true); |
| 45 | + } |
| 46 | + |
| 47 | + public function testWorkflowClientCallsInterceptor(): void |
| 48 | + { |
| 49 | + new class implements WorkflowClientCallsInterceptor { |
| 50 | + use WorkflowClientCallsInterceptorTrait; |
| 51 | + }; |
| 52 | + |
| 53 | + self::assertTrue(true); |
| 54 | + } |
| 55 | + |
| 56 | + public function testWorkflowInboundCallsInterceptor(): void |
| 57 | + { |
| 58 | + new class implements WorkflowInboundCallsInterceptor { |
| 59 | + use WorkflowInboundCallsInterceptorTrait; |
| 60 | + }; |
| 61 | + |
| 62 | + self::assertTrue(true); |
| 63 | + } |
| 64 | + |
| 65 | + public function testWorkflowOutboundCallsInterceptor(): void |
| 66 | + { |
| 67 | + new class implements WorkflowOutboundCallsInterceptor { |
| 68 | + use WorkflowOutboundCallsInterceptorTrait; |
| 69 | + }; |
| 70 | + |
| 71 | + self::assertTrue(true); |
| 72 | + } |
| 73 | + |
| 74 | + public function testWorkflowOutboundRequestInterceptor(): void |
| 75 | + { |
| 76 | + new class implements WorkflowOutboundRequestInterceptor { |
| 77 | + use WorkflowOutboundRequestInterceptorTrait; |
| 78 | + }; |
| 79 | + |
| 80 | + self::assertTrue(true); |
| 81 | + } |
| 82 | +} |
0 commit comments