-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT Fix some unit tests #415
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
'/<input type="text" name="TestGridField\[GridFieldEditableColumns\]\[100\]\[Title\]" value="foo"[^>]*>/', | ||
$column->getValue() | ||
$column | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value for the column comes from |
||
); | ||
} | ||
|
||
|
@@ -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 | ||
); | ||
} | ||
|
||
|
@@ -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 | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See line 31 above - this was a typo which resulted in a PHP deprecation warning in CI. Super minor, doesn't really matter until they actually remove the ability to have dynamic properties and it's only a unit test so I don't think it's worth backporting. |
||
} | ||
|
||
protected function tearDown(): void | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither of these are used