mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 18:51:12 +02:00
20 lines
546 B
PHP
20 lines
546 B
PHP
|
<?php
|
||
|
|
||
|
class HasManyListTest extends SapphireTest {
|
||
|
|
||
|
// Borrow the model from DataObjectTest
|
||
|
public static $fixture_file = 'DataObjectTest.yml';
|
||
|
|
||
|
protected $extraDataObjects = array(
|
||
|
'DataObjectTest_Team',
|
||
|
'DataObjectTest_SubTeam',
|
||
|
'DataObjectTest_Player',
|
||
|
);
|
||
|
|
||
|
public function testRelationshipEmptyOnNewRecords() {
|
||
|
// Relies on the fact that (unrelated) comments exist in the fixture file already
|
||
|
$newTeam = new DataObjectTest_Team(); // has_many Comments
|
||
|
$this->assertEquals(array(), $newTeam->Comments()->column('ID'));
|
||
|
}
|
||
|
|
||
|
}
|