mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
33 lines
1022 B
PHP
33 lines
1022 B
PHP
<?php
|
|
|
|
use Sunnysideup\DMS\Extensions\DMSDocumentTaxonomyExtension;
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
class DMSDocumentTaxonomyExtensionTest extends SapphireTest
|
|
{
|
|
protected static $fixture_file = 'DMSDocumentTaxonomyExtensionTest.yml';
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
if (!class_exists('TaxonomyType')) {
|
|
$this->markTestSkipped('This test requires silverstripe/taxonomy ^1.2 to be installed. Skipping.');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ensure that appropriate tags by taxonomy type are returned, and that their hierarchy is displayd in the title
|
|
*/
|
|
public function testGetAllTagsMap()
|
|
{
|
|
$extension = new DMSDocumentTaxonomyExtension;
|
|
$result = $extension->getAllTagsMap();
|
|
|
|
$this->assertContains('Subject > Mathematics', $result);
|
|
$this->assertContains('Subject', $result);
|
|
$this->assertContains('Subject > Science > Chemistry', $result);
|
|
$this->assertNotContains('Physical Education', $result);
|
|
}
|
|
}
|