Skip to content

Commit db4fed1

Browse files
Merge pull request #231 from creative-commoners/pulls/7/php85
MNT Update unit tests for PHP 8.5
2 parents 98efc3f + be5c5d8 commit db4fed1

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

tests/php/Publisher/FilesystemPublisherTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ public function testUrlToPathWithRelativeUrls(): void
6666
{
6767
$reflection = new \ReflectionClass(FilesystemPublisher::class);
6868
$urlToPath = $reflection->getMethod('URLtoPath');
69-
$urlToPath->setAccessible(true);
70-
7169
$this->assertSame(
7270
'index',
7371
$urlToPath->invokeArgs($this->fsp, ['/'])
@@ -88,8 +86,6 @@ public function testUrlToPathWithAbsoluteUrls(): void
8886
{
8987
$reflection = new \ReflectionClass(FilesystemPublisher::class);
9088
$urlToPath = $reflection->getMethod('URLtoPath');
91-
$urlToPath->setAccessible(true);
92-
9389
$url = Director::absoluteBaseUrl();
9490
$this->assertSame(
9591
'index',
@@ -115,8 +111,6 @@ public function testUrlToPathWithDomainBasedCaching(): void
115111

116112
$reflection = new \ReflectionClass(FilesystemPublisher::class);
117113
$urlToPath = $reflection->getMethod('URLtoPath');
118-
$urlToPath->setAccessible(true);
119-
120114
$this->fsp->setFileExtension('html');
121115

122116
$url = 'http://domain1.com/';
@@ -150,8 +144,6 @@ public function testMenu2LinkingMode(): void
150144

151145
$reflection = new \ReflectionClass(FilesystemPublisher::class);
152146
$urlToPath = $reflection->getMethod('URLtoPath');
153-
$urlToPath->setAccessible(true);
154-
155147
$level1 = new StaticPublisherTestPage();
156148
$level1->URLSegment = 'test-level-1';
157149
$level1->write();
@@ -338,8 +330,6 @@ public function testPathToURL($expected, $path): void
338330
{
339331
$reflection = new \ReflectionClass(FilesystemPublisher::class);
340332
$pathToURL = $reflection->getMethod('pathToURL');
341-
$pathToURL->setAccessible(true);
342-
343333
$this->assertSame(
344334
$expected,
345335
$pathToURL->invoke($this->fsp, $this->fsp->getDestPath() . $path)

tests/php/Service/UrlBundleServiceTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function testUrlsPerJob(string $jobClass, int $urlsPerJob): void
6969
$job = singleton($jobClass);
7070

7171
$method = new ReflectionMethod(Job::class, 'getUrlsPerJob');
72-
$method->setAccessible(true);
7372
$this->assertEquals($urlsPerJob, $method->invoke($job));
7473
}
7574

@@ -82,7 +81,6 @@ public function testChunkSize(string $jobClass, int $chunkSize): void
8281
$job = singleton($jobClass);
8382

8483
$method = new ReflectionMethod(Job::class, 'getChunkSize');
85-
$method->setAccessible(true);
8684
$this->assertEquals($chunkSize, $method->invoke($job));
8785
}
8886

@@ -138,7 +136,6 @@ public function testGetUrls(): void
138136
$urlService = UrlBundleService::create();
139137
$urlService->addUrls($urls);
140138
$method = new ReflectionMethod($urlService, 'getUrls');
141-
$method->setAccessible(true);
142139
$resultUrls = $method->invoke($urlService);
143140

144141
$this->assertEqualsCanonicalizing($expectedUrls, $resultUrls);
@@ -156,7 +153,6 @@ public function testGetUrlsDontStripStage(): void
156153
$urlService = UrlBundleService::create();
157154
$urlService->addUrls($urls);
158155
$method = new ReflectionMethod($urlService, 'getUrls');
159-
$method->setAccessible(true);
160156
$resultUrls = $method->invoke($urlService);
161157

162158
$this->assertEqualsCanonicalizing($urls, $resultUrls);
@@ -169,8 +165,6 @@ public function testStripStageParam(string $url, string $expectedUrl): void
169165

170166
$urlService = UrlBundleService::create();
171167
$method = new ReflectionMethod($urlService, 'stripStageParam');
172-
$method->setAccessible(true);
173-
174168
$this->assertEquals($expectedUrl, $method->invoke($urlService, $url));
175169
}
176170

0 commit comments

Comments
 (0)