mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
23 lines
700 B
PHP
23 lines
700 B
PHP
<?php
|
|
|
|
class DMSDocumentAddExistingFieldTest extends SapphireTest
|
|
{
|
|
/**
|
|
* The constructor should create a tree dropdown field
|
|
*/
|
|
public function testFieldContainsTreeDropdownField()
|
|
{
|
|
$field = new DMSDocumentAddExistingField('Test', 'Test');
|
|
$this->assertContainsOnlyInstancesOf('TreeDropdownField', $field->getChildren());
|
|
$this->assertSame('PageSelector', $field->getChildren()->first()->getName());
|
|
}
|
|
|
|
public function testSetAndGetRecord()
|
|
{
|
|
$record = new DMSDocumentSet;
|
|
$field = new DMSDocumentAddExistingField('Test');
|
|
$field->setRecord($record);
|
|
$this->assertSame($record, $field->getRecord());
|
|
}
|
|
}
|