-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MNT Add tests for overriding DataObject via injection
- Loading branch information
1 parent
29fae72
commit 0482444
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace SilverStripe\ORM\Tests\DataObjectTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
|
||
class InjectedDataObject extends OverriddenDataObject implements TestOnly | ||
{ | ||
private static $db = [ | ||
'NewField' => 'Varchar', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace SilverStripe\ORM\Tests\DataObjectTest; | ||
|
||
use SilverStripe\Dev\TestOnly; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class OverriddenDataObject extends DataObject implements TestOnly | ||
{ | ||
private static $table_name = 'DataObjectTest_OverriddenDataObject'; | ||
|
||
private static $db = [ | ||
'Salary' => 'BigInt', | ||
'EmploymentType' => 'Varchar', | ||
]; | ||
|
||
private static $has_one = [ | ||
'CurrentCompany' => Company::class, | ||
]; | ||
} |