Skip to content

Commit

Permalink
MNT Fix some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 23, 2024
1 parent c3ddeb3 commit 46185e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions tests/GridFieldEditableColumnsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -47,10 +45,9 @@ public function testProvidesEditableFieldsInColumns()
$record->setCanEdit(true);
$column = $component->getColumnContent($grid, $record, 'Title');

$this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/<input type="text" name="TestGridField\[GridFieldEditableColumns\]\[100\]\[Title\]" value="foo"[^>]*>/',
$column->getValue()
$column
);
}

Expand All @@ -63,10 +60,9 @@ public function testProvidesReadonlyColumnsForNoneditableRecords()
$record->setCanEdit(false);
$column = $component->getColumnContent($grid, $record, 'Title');

$this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/<span[^>]*>\s*testval\s*<\/span>/',
$column->getValue()
$column
);
}

Expand All @@ -85,10 +81,9 @@ public function testProvidesReadonlyColumnsForReadonlyGrids()

$column = $component->getColumnContent($grid, $record, 'Title');

$this->assertInstanceOf(DBHTMLText::class, $column);
$this->assertMatchesRegularExpression(
'/<span[^>]*>\s*testval\s*<\/span>/',
$column->getValue()
$column
);
}
}
2 changes: 1 addition & 1 deletion tests/OrderableRowsThroughVersionedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46185e6

Please sign in to comment.