BUGFIX: Fixed manifest builder tests to not have fake data, and to test that classes can be in files with different names

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84065 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-08-08 03:39:12 +00:00
parent 63d5691fb2
commit 25f22d3e99
2 changed files with 21 additions and 5 deletions

View File

@ -15,6 +15,16 @@ PHP
'sapphire/MyClass.php' => <<<PHP
<?php
interface MyInterface {
}
interface OtherInterface {
}
class BaseClass {
}
/* This is a comment before */
class MyClass extends Object {
@ -22,11 +32,11 @@ class MyClass extends Object {
/* This is a comment between */
class MyClass_Other extends DataObject implements Something {
class MyClass_Other extends DataObject implements MyInterface {
}
class MyClass_Final extends DataObject implements Something, OtherClass {
class MyClass_Final extends DataObject implements MyInterface, OtherInterface {
}
@ -83,7 +93,7 @@ PHP
'sapphire/subdir/SubDirClass.php' => <<<PHP
<?php
class SubDirClass extends Something implements Else, Other {
class SubDirClass extends BaseClass implements MyInterace, OtherInterface {
}
PHP
@ -93,7 +103,7 @@ PHP
'otherdir/OtherFile.php' => <<<PHP
<?php
class OtherFile extends Object {
class OtherFile extends BaseClass {
}
PHP

View File

@ -31,7 +31,6 @@ class ManifestBuilderTest extends SapphireTest {
$this->assertEquals(1, preg_match('/require_once\("[^"]+sapphire\/_config.php"\);/i', $manifest), "sapphire/_config.php included");
}
function testManifestIgnoresClassesInComments() {
$baseFolder = TEMP_FOLDER . '/manifest-test';
global $project;
@ -69,6 +68,13 @@ class ManifestBuilderTest extends SapphireTest {
$this->assertNotContains('MyClass_InHeredocString', array_keys($manifestInfo['globals']['_ALL_CLASSES']['parents']));
}
function testClassNamesDontHaveToBeTheSameAsFileNames() {
$baseFolder = TEMP_FOLDER . '/manifest-test';
$manifestInfo = ManifestBuilder::get_manifest_info($baseFolder);
$this->assertContains('BaseClass', array_keys($manifestInfo['globals']['_ALL_CLASSES']['exists']));
}
protected $originalClassManifest, $originalProject, $originalAllClasses;
protected static $test_fixture_project;