mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
34 lines
922 B
PHP
34 lines
922 B
PHP
<?php
|
|
|
|
use Sunnysideup\DMS\Extensions\DMSTaxonomyTypeExtension;
|
|
use SilverStripe\Core\Config\Config;
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
class DMSTaxonomyTypeExtensionTest extends SapphireTest
|
|
{
|
|
protected $usesDatabase = true;
|
|
|
|
protected $required_extensions = array(
|
|
'TaxonomyType' => array(DMSTaxonomyTypeExtension::class)
|
|
);
|
|
|
|
/**
|
|
* Ensure that the configurable list of default records are created
|
|
*/
|
|
public function testDefaultRecordsAreCreated()
|
|
{
|
|
Config::modify()->update(DMSTaxonomyTypeExtension::class, 'default_records', array('Food', 'Beverage', 'Books'));
|
|
|
|
TaxonomyType::create()->requireDefaultRecords();
|
|
|
|
$this->assertDOSContains(
|
|
array(
|
|
array('Name' => 'Food'),
|
|
array('Name' => 'Beverage'),
|
|
array('Name' => 'Books'),
|
|
),
|
|
TaxonomyType::get()
|
|
);
|
|
}
|
|
}
|