mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Made it possible to disable caching on a class manifest via a constructor parameter, and used this in ClassManifestTest.
This commit is contained in:
parent
7df8929bc0
commit
07b1308cd4
@ -77,8 +77,9 @@ class SS_ClassManifest {
|
|||||||
* @param string $base The manifest base path.
|
* @param string $base The manifest base path.
|
||||||
* @param bool $includeTests Include the contents of "tests" directories.
|
* @param bool $includeTests Include the contents of "tests" directories.
|
||||||
* @param bool $forceRegen Force the manifest to be regenerated.
|
* @param bool $forceRegen Force the manifest to be regenerated.
|
||||||
|
* @param bool $cache If the manifest is regenerated, cache it.
|
||||||
*/
|
*/
|
||||||
public function __construct($base, $includeTests = false, $forceRegen = false) {
|
public function __construct($base, $includeTests = false, $forceRegen = false, $cache = true) {
|
||||||
$this->base = $base;
|
$this->base = $base;
|
||||||
$this->tests = $includeTests;
|
$this->tests = $includeTests;
|
||||||
|
|
||||||
@ -95,7 +96,7 @@ class SS_ClassManifest {
|
|||||||
$this->implementors = $data['implementors'];
|
$this->implementors = $data['implementors'];
|
||||||
$this->configs = $data['configs'];
|
$this->configs = $data['configs'];
|
||||||
} else {
|
} else {
|
||||||
$this->regenerate();
|
$this->regenerate($cache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ class ClassManifestTest extends SapphireTest {
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->base = dirname(__FILE__) . '/fixtures/classmanifest';
|
$this->base = dirname(__FILE__) . '/fixtures/classmanifest';
|
||||||
$this->manifest = new SS_ClassManifest($this->base, false, true);
|
$this->manifest = new SS_ClassManifest($this->base, false, true, false);
|
||||||
$this->manifestTests = new SS_ClassManifest($this->base, true, true);
|
$this->manifestTests = new SS_ClassManifest($this->base, true, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetItemPath() {
|
public function testGetItemPath() {
|
||||||
|
Loading…
Reference in New Issue
Block a user