From 07b1308cd49d5ae7a89a47ce7b116ac489257d17 Mon Sep 17 00:00:00 2001 From: ajshort Date: Wed, 23 Mar 2011 01:22:44 +1100 Subject: [PATCH] MINOR: Made it possible to disable caching on a class manifest via a constructor parameter, and used this in ClassManifestTest. --- manifest/ClassManifest.php | 5 +++-- tests/manifest/ClassManifestTest.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifest/ClassManifest.php b/manifest/ClassManifest.php index c45c71fc5..e11633d1b 100644 --- a/manifest/ClassManifest.php +++ b/manifest/ClassManifest.php @@ -77,8 +77,9 @@ class SS_ClassManifest { * @param string $base The manifest base path. * @param bool $includeTests Include the contents of "tests" directories. * @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->tests = $includeTests; @@ -95,7 +96,7 @@ class SS_ClassManifest { $this->implementors = $data['implementors']; $this->configs = $data['configs']; } else { - $this->regenerate(); + $this->regenerate($cache); } } diff --git a/tests/manifest/ClassManifestTest.php b/tests/manifest/ClassManifestTest.php index ac65467c7..701aa8cac 100644 --- a/tests/manifest/ClassManifestTest.php +++ b/tests/manifest/ClassManifestTest.php @@ -15,8 +15,8 @@ class ClassManifestTest extends SapphireTest { parent::setUp(); $this->base = dirname(__FILE__) . '/fixtures/classmanifest'; - $this->manifest = new SS_ClassManifest($this->base, false, true); - $this->manifestTests = new SS_ClassManifest($this->base, true, true); + $this->manifest = new SS_ClassManifest($this->base, false, true, false); + $this->manifestTests = new SS_ClassManifest($this->base, true, true, false); } public function testGetItemPath() {