silverstripe-framework/tests/php/Core/Manifest/ModuleTest.php
Maxime Rainville 1e01deea39 NEW Make resources dir configurable (#8519)
* NEW Make resources dir configurable.

* Removing reference to old `resources` and updating doc #8519

* Rrtarget to 4.4 release.

* DOC Reference SS_RESOURCES_DIR in Environment doc.

* API Add a Resources method to SilverStripe\Core\Manifest\Module to read the resources-dir from composer.json

* Clean up reference to SS_RESOURCES_DIR env var

* Set default resources-dir

* Update test to use RESOURCES_DIR const in expected resource url method

* Correcting typos

Co-Authored-By: maxime-rainville <maxime@rainville.me>

* MINOR Correctubg minor typos

* DOCS Document the intricacies of exposing static assets.
2019-01-09 15:35:45 +13:00

25 lines
697 B
PHP

<?php
namespace SilverStripe\Core\Tests\Manifest;
use SilverStripe\Control\Director;
use SilverStripe\Core\Manifest\Module;
use SilverStripe\Dev\SapphireTest;
class ModuleTest extends SapphireTest
{
public function testUnsetResourcesDir()
{
$path = __DIR__ . '/fixtures/ss-projects/withoutCustomResourcesDir';
$module = new Module($path, $path);
$this->assertEquals('', $module->getResourcesDir());
}
public function testResourcesDir()
{
$path = __DIR__ . '/fixtures/ss-projects/withCustomResourcesDir';
$module = new Module($path, $path);
$this->assertEquals('customised-resources-dir', $module->getResourcesDir());
}
}