From 4bbfa9d298f5d5e7021be0c4849d011b28e2064c Mon Sep 17 00:00:00 2001
From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Date: Wed, 28 Aug 2024 10:54:54 +1200
Subject: [PATCH] MNT Fix some unit tests (#415)
---
tests/GridFieldEditableColumnsTest.php | 11 +++--------
tests/OrderableRowsThroughVersionedTest.php | 2 +-
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/tests/GridFieldEditableColumnsTest.php b/tests/GridFieldEditableColumnsTest.php
index fc9a9b9..2a5abb5 100644
--- a/tests/GridFieldEditableColumnsTest.php
+++ b/tests/GridFieldEditableColumnsTest.php
@@ -5,8 +5,6 @@
use Symbiote\GridFieldExtensions\Tests\Stub\TestController;
use Symbiote\GridFieldExtensions\Tests\Stub\StubUnorderable;
use Symbiote\GridFieldExtensions\GridFieldEditableColumns;
-use SilverStripe\ORM\FieldType\DBHTMLText;
-use SilverStripe\Forms\TextField;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FieldList;
@@ -47,10 +45,9 @@ public function testProvidesEditableFieldsInColumns()
$record->setCanEdit(true);
$column = $component->getColumnContent($grid, $record, 'Title');
- $this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/]*>/',
- $column->getValue()
+ $column
);
}
@@ -63,10 +60,9 @@ public function testProvidesReadonlyColumnsForNoneditableRecords()
$record->setCanEdit(false);
$column = $component->getColumnContent($grid, $record, 'Title');
- $this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/]*>\s*testval\s*<\/span>/',
- $column->getValue()
+ $column
);
}
@@ -85,10 +81,9 @@ public function testProvidesReadonlyColumnsForReadonlyGrids()
$column = $component->getColumnContent($grid, $record, 'Title');
- $this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/]*>\s*testval\s*<\/span>/',
- $column->getValue()
+ $column
);
}
}
diff --git a/tests/OrderableRowsThroughVersionedTest.php b/tests/OrderableRowsThroughVersionedTest.php
index a7190fc..2a2ab1f 100644
--- a/tests/OrderableRowsThroughVersionedTest.php
+++ b/tests/OrderableRowsThroughVersionedTest.php
@@ -33,7 +33,7 @@ class OrderableRowsThroughVersionedTest extends SapphireTest
protected function setUp(): void
{
parent::setUp();
- $this->orignalReadingMode = Versioned::get_reading_mode();
+ $this->originalReadingMode = Versioned::get_reading_mode();
}
protected function tearDown(): void