Skip to content

Commit 96ddbff

Browse files
committed
Repair SwaggerPathsTest
1 parent affae80 commit 96ddbff

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

tests/SwaggerPathsTest.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,6 @@ public function testOperationIdGeneration(): void
5050
$this->assertIsArray($property->getValue($swaggerPaths));
5151
}
5252

53-
public function testOperationIdInstanceIsolation(): void
54-
{
55-
$container = m::mock(ContainerInterface::class);
56-
$config = m::mock(ConfigInterface::class);
57-
$logger = m::mock(StdoutLoggerInterface::class);
58-
$swaggerOpenApi = m::mock(SwaggerOpenApi::class);
59-
$swaggerCommon = new SwaggerCommon();
60-
61-
$swaggerPaths1 = new SwaggerPaths(
62-
'http',
63-
$config,
64-
$logger,
65-
$swaggerOpenApi,
66-
$swaggerCommon
67-
);
68-
69-
$swaggerPaths2 = new SwaggerPaths(
70-
'http2',
71-
$config,
72-
$logger,
73-
$swaggerOpenApi,
74-
$swaggerCommon
75-
);
76-
77-
$reflection1 = new ReflectionClass($swaggerPaths1);
78-
$property1 = $reflection1->getProperty('operationIds');
79-
$property1->setAccessible(true);
80-
81-
$reflection2 = new ReflectionClass($swaggerPaths2);
82-
$property2 = $reflection2->getProperty('operationIds');
83-
$property2->setAccessible(true);
84-
85-
$property1->setValue($swaggerPaths1, ['test' => true]);
86-
87-
$this->assertArrayNotHasKey('test', $property2->getValue($swaggerPaths2));
88-
}
89-
9053
public function testGetClassMethodPath(): void
9154
{
9255
$container = m::mock(ContainerInterface::class);
@@ -104,7 +67,6 @@ public function testGetClassMethodPath(): void
10467
);
10568

10669
$method = new ReflectionMethod($swaggerPaths, 'getClassMethodPath');
107-
$method->setAccessible(true);
10870

10971
$result = $method->invoke($swaggerPaths, 'Hyperf\ApiDocs\Controller\UserController', 'getUser');
11072

@@ -129,7 +91,6 @@ public function testGetClassMethodPathWithShortNamespace(): void
12991
);
13092

13193
$method = new ReflectionMethod($swaggerPaths, 'getClassMethodPath');
132-
$method->setAccessible(true);
13394

13495
$result = $method->invoke($swaggerPaths, 'Controller\UserController', 'index');
13596

0 commit comments

Comments
 (0)