From 0cb9d96ab32b4da2de96b299063d7ccf152b2782 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:58:30 +1200 Subject: [PATCH] MNT Update method signature for test class (#191) --- code/Report.php | 2 +- code/SideReportView.php | 4 ++-- tests/ReportTest/FakeObject.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/Report.php b/code/Report.php index 1842a48a..bce53349 100644 --- a/code/Report.php +++ b/code/Report.php @@ -431,7 +431,7 @@ public function getReportField() if ($item instanceof CMSPreviewable) { return sprintf( '%s', - Convert::raw2att($item->CMSEditLink()), + Convert::raw2att($item->getCMSEditLink()), Convert::raw2att($value), Convert::raw2xml($value) ); diff --git a/code/SideReportView.php b/code/SideReportView.php index e7d627b1..0c09a725 100644 --- a/code/SideReportView.php +++ b/code/SideReportView.php @@ -95,8 +95,8 @@ protected function formatValue($record, $source, $info) } 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 . "$val"; } else { diff --git a/tests/ReportTest/FakeObject.php b/tests/ReportTest/FakeObject.php index 9951b172..4448f77f 100644 --- a/tests/ReportTest/FakeObject.php +++ b/tests/ReportTest/FakeObject.php @@ -24,7 +24,7 @@ public function Link() return Controller::join_links('dummy-link', $this->ID); } - public function CMSEditLink() + public function getCMSEditLink(): ?string { return Controller::join_links('dummy-edit-link', $this->ID); }