mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
FIX Fixing test errors
This commit is contained in:
parent
537f4da88f
commit
804ff7c247
@ -328,7 +328,7 @@ class Report extends ViewableData
|
||||
* Generally, you should override {@link columns()} and {@link records()} to make your report,
|
||||
* but if they aren't sufficiently flexible, then you can override this method.
|
||||
*
|
||||
* @return FormField subclass
|
||||
* @return \SilverStripe\Forms\FormField subclass
|
||||
*/
|
||||
public function getReportField()
|
||||
{
|
||||
@ -373,8 +373,9 @@ class Report extends ViewableData
|
||||
if ($item instanceof CMSPreviewable) {
|
||||
/** @var CMSPreviewable $item */
|
||||
return sprintf(
|
||||
'<a class="grid-field__link-block" href="%s">%s</a>',
|
||||
'<a class="grid-field__link-block" href="%s" title="%s">%s</a>',
|
||||
Convert::raw2att($item->CMSEditLink()),
|
||||
Convert::raw2att($value),
|
||||
Convert::raw2xml($value)
|
||||
);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ use SilverStripe\Control\Session;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
use SilverStripe\Admin\CMSPreviewable ;
|
||||
use SilverStripe\Forms\GridField\GridFieldDataColumns;
|
||||
|
||||
|
||||
/**
|
||||
@ -98,14 +99,14 @@ class ReportTest extends SapphireTest
|
||||
/** @var GridField $gridField */
|
||||
$gridField = $report->getReportField();
|
||||
/** @var GridFieldDataColumns $columns */
|
||||
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
|
||||
$columns = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
|
||||
|
||||
$page = new ReportTest_FakeObject();
|
||||
$page->Title = 'My Object';
|
||||
$page->ID = 959547;
|
||||
|
||||
$titleContent = $columns->getColumnContent($gridField, $page, 'Title');
|
||||
$this->assertEquals('<a href="dummy-edit-link/959547" title="My Object">My Object</a>', $titleContent);
|
||||
$this->assertEquals('<a class="grid-field__link-block" href="dummy-edit-link/959547" title="My Object">My Object</a>', $titleContent);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user