Skip to content

Commit db5ea6e

Browse files
committed
minor #450 [Platform] Remove unnecessary setAccessible() calls (OskarStark)
This PR was merged into the main branch. Discussion ---------- [Platform] Remove unnecessary `setAccessible()` calls | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Commits ------- a6c1424 Remove unnecessary setAccessible(true) calls
2 parents 805b5d6 + a6c1424 commit db5ea6e

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/platform/tests/Bridge/HuggingFace/ModelClientTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function testGetUrlForDifferentInputsAndTasks(?string $task, string $expe
3737
{
3838
$reflection = new \ReflectionClass(ModelClient::class);
3939
$getUrlMethod = $reflection->getMethod('getUrl');
40-
$getUrlMethod->setAccessible(true);
4140

4241
$model = new Model('test-model');
4342
$httpClient = new MockHttpClient();
@@ -87,7 +86,6 @@ public function testGetPayloadForDifferentInputsAndTasks(object|array|string $in
8786

8887
$reflection = new \ReflectionClass(ModelClient::class);
8988
$getPayloadMethod = $reflection->getMethod('getPayload');
90-
$getPayloadMethod->setAccessible(true);
9189

9290
$httpClient = new MockHttpClient();
9391
$modelClient = new ModelClient($httpClient, 'test-provider', 'test-api-key');

src/platform/tests/Bridge/LmStudio/Completions/ModelClientTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public function testItUsesEventSourceHttpClient()
9292
$client = new ModelClient($httpClient, 'http://localhost:1234');
9393

9494
$reflection = new \ReflectionProperty($client, 'httpClient');
95-
$reflection->setAccessible(true);
9695

9796
$this->assertInstanceOf(EventSourceHttpClient::class, $reflection->getValue($client));
9897
}
@@ -103,7 +102,6 @@ public function testItKeepsExistingEventSourceHttpClient()
103102
$client = new ModelClient($eventSourceHttpClient, 'http://localhost:1234');
104103

105104
$reflection = new \ReflectionProperty($client, 'httpClient');
106-
$reflection->setAccessible(true);
107105

108106
$this->assertSame($eventSourceHttpClient, $reflection->getValue($client));
109107
}

0 commit comments

Comments
 (0)