Skip to content

Commit f39a9f4

Browse files
committed
feat: move test from harness to extra namespace
1 parent 0fb588c commit f39a9f4

File tree

2 files changed

+62
-98
lines changed

2 files changed

+62
-98
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Temporal\Tests\Acceptance\Extra\DataConverter\RawValue;
6+
7+
use PHPUnit\Framework\Attributes\Test;
8+
use Temporal\Activity\ActivityInterface;
9+
use Temporal\Activity\ActivityMethod;
10+
use Temporal\Activity\ActivityOptions;
11+
use Temporal\Api\Common\V1\Payload;
12+
use Temporal\Client\WorkflowStubInterface;
13+
use Temporal\DataConverter\RawValue;
14+
use Temporal\Tests\Acceptance\App\Attribute\Stub;
15+
use Temporal\Tests\Acceptance\App\TestCase;
16+
use Temporal\Workflow;
17+
use Temporal\Workflow\WorkflowInterface;
18+
use Temporal\Workflow\WorkflowMethod;
19+
20+
class RawValueTest extends TestCase
21+
{
22+
#[Test]
23+
public function check(
24+
#[Stub('Extra_DataConverter_RawValue')]
25+
WorkflowStubInterface $stub,
26+
): void {
27+
$result = $stub->getResult(RawValue::class);
28+
29+
self::assertInstanceOf(RawValue::class, $result);
30+
self::assertInstanceOf(Payload::class, $result->getPayload());
31+
self::assertSame('hello world', $result->getPayload()->getData());
32+
}
33+
}
34+
35+
#[WorkflowInterface]
36+
class FeatureWorkflow
37+
{
38+
#[WorkflowMethod('Extra_DataConverter_RawValue')]
39+
public function run()
40+
{
41+
$rawValue = new RawValue(new Payload(['data' => 'hello world']));
42+
43+
yield Workflow::newActivityStub(
44+
RawValueActivity::class,
45+
ActivityOptions::new()
46+
->withStartToCloseTimeout(10),
47+
)
48+
->bypass($rawValue);
49+
50+
return yield $rawValue;
51+
}
52+
}
53+
54+
#[ActivityInterface(prefix: 'RawValueActivity.')]
55+
class RawValueActivity
56+
{
57+
#[ActivityMethod('Bypass')]
58+
public function bypass(RawValue $arg): iterable
59+
{
60+
yield $arg;
61+
}
62+
}

tests/Acceptance/Harness/DataConverter/RawValueTest.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)