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:
ajshort 2011-03-23 01:22:44 +11:00
parent 7df8929bc0
commit 07b1308cd4
2 changed files with 5 additions and 4 deletions

View File

@ -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);
} }
} }

View File

@ -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() {