mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
63d5691fb2
commit
25f22d3e99
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user