silverstripe-gridfieldexten.../tests/Stub/StubParent.php
Dylan Wagstaff b6130c4e11 Add unit tests for new ManyManyThrough support
The previous commit (9fa9ef89) added support for the new SilverStripe 4
feature of Many Many relationships through an intermediary object. After
much head scratching and community testing, the solution was proven to
work, however had no automated tests to confirm as such. This commit
rectifies that by testing both versioned and unversioned DataObjects in
a many_many through style relationship. Some minor tidy and comments
were also added as per feedback on the functionality code changes.
2018-06-26 14:41:39 +12:00

26 lines
642 B
PHP

<?php
namespace Symbiote\GridFieldExtensions\Tests\Stub;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\DataObject;
class StubParent extends DataObject implements TestOnly
{
private static $has_many = [
'MyHasMany' => StubOrdered::class,
'MyHasManySubclass' => StubSubclass::class,
'MyHasManySubclassOrderedVersioned' => StubSubclassOrderedVersioned::class,
];
private static $many_many = [
'MyManyMany' => StubOrdered::class,
];
private static $many_many_extraFields = [
'MyManyMany' => ['ManyManySort' => 'Int'],
];
private static $table_name = 'StubParent';
}