MNT Update method signature for test class (#191)

This commit is contained in:
Guy Sartorelli 2024-08-26 09:58:30 +12:00 committed by GitHub
parent be2dc34ca6
commit 0cb9d96ab3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -431,7 +431,7 @@ class Report extends ViewableData
if ($item instanceof CMSPreviewable) {
return sprintf(
'<a class="grid-field__link-block" href="%s" title="%s">%s</a>',
Convert::raw2att($item->CMSEditLink()),
Convert::raw2att($item->getCMSEditLink()),
Convert::raw2att($value),
Convert::raw2xml($value)
);

View File

@ -95,8 +95,8 @@ class SideReportView extends ViewableData
}
if (isset($info['link']) && $info['link']) {
$link = ($info['link'] === true && $record->hasMethod('CMSEditLink'))
? $record->CMSEditLink()
$link = ($info['link'] === true && $record->hasMethod('getCMSEditLink'))
? $record->getCMSEditLink()
: $info['link'];
return $prefix . "<a $classClause href=\"$link\">$val</a>";
} else {

View File

@ -24,7 +24,7 @@ class FakeObject extends DataObject implements CMSPreviewable, TestOnly
return Controller::join_links('dummy-link', $this->ID);
}
public function CMSEditLink()
public function getCMSEditLink(): ?string
{
return Controller::join_links('dummy-edit-link', $this->ID);
}