Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/php/Controllers/LinkFieldControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public function testExcludeLinkTextField(bool $excludeLinkTextField): void
$request->setSession(new Session([]));
$controller = new LinkFieldController();
$reflectionFindAction = new ReflectionMethod($controller, 'findAction');
$reflectionFindAction->setAccessible(true);
$reflectionFindAction->invoke($controller, $request);
$controller->setRequest($request);
$form = $controller->linkForm();
Expand Down
1 change: 0 additions & 1 deletion tests/php/Form/AbstractLinkFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function testElementalNamespaceRemoved(): void
$form->loadDataFrom($block);
$reflector = new ReflectionObject($field);
$method = $reflector->getMethod('getOwnerFields');
$method->setAccessible(true);
$res = $method->invoke($field);
$this->assertEquals([
'ID' => $block->ID,
Expand Down
1 change: 0 additions & 1 deletion tests/php/Form/MultiLinkFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function testConvertValueToArray(mixed $value, array $expected): void
{
$field = new MultiLinkField('');
$reflectionMethod = new ReflectionMethod($field, 'convertValueToArray');
$reflectionMethod->setAccessible(true);
$this->assertSame($expected, $reflectionMethod->invoke($field, $value));
}

Expand Down
2 changes: 0 additions & 2 deletions tests/php/Models/FileLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public function testGetDescription(): void
public function testGetDefaultTitle(): void
{
$reflectionGetDefaultTitle = new ReflectionMethod(FileLink::class, 'getDefaultTitle');
$reflectionGetDefaultTitle->setAccessible(true);

// File does not exist
$link = new FileLink();
$this->assertSame('(File missing)', $reflectionGetDefaultTitle->invoke($link));
Expand Down
2 changes: 0 additions & 2 deletions tests/php/Models/SiteTreeLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public function testGetDescription(): void
public function testGetDefaultTitle(): void
{
$reflectionGetDefaultTitle = new ReflectionMethod(SiteTreeLink::class, 'getDefaultTitle');
$reflectionGetDefaultTitle->setAccessible(true);

// Page does not exist
$link = new SiteTreeLink();
$this->assertSame('(Page missing)', $reflectionGetDefaultTitle->invoke($link));
Expand Down
3 changes: 0 additions & 3 deletions tests/php/Tasks/GorriecoeMigrationTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,15 @@ private function callPrivateMethod(string $methodName, array $args = []): mixed
$task = new GorriecoeMigrationTask();
$output = new PolyOutput(PolyOutput::FORMAT_ANSI, wrappedOutput: $this->buffer);
$reflectionProperty = new ReflectionProperty($task, 'output');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($task, $output);

// getNeedsMigration() sets the table to pull from.
// If we're not testing that method, we need to set the table ourselves.
if ($this->name() !== 'testGetNeedsMigration') {
$reflectionProperty = new ReflectionProperty($task, 'oldTableName');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($task, self::OLD_LINK_TABLE);
}
$reflectionMethod = new ReflectionMethod($task, $methodName);
$reflectionMethod->setAccessible(true);
return $reflectionMethod->invoke($task, ...$args);
}
}