mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #10893 from lekoala/patch-42
include silverstripe core files into roots
This commit is contained in:
commit
6ed50b5279
@ -650,6 +650,11 @@ class ClassManifest
|
|||||||
}
|
}
|
||||||
$this->children[$lowerAncestor][$lowerClassName] = $className;
|
$this->children[$lowerAncestor][$lowerClassName] = $className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the class extends a core class, add class to roots
|
||||||
|
if (strpos($ancestor, 'SilverStripe\\Control') === 0) {
|
||||||
|
$this->roots[$lowerAncestor] = $ancestor;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->roots[$lowerClassName] = $className;
|
$this->roots[$lowerClassName] = $className;
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,14 @@ class ClassInfoTest extends SapphireTest
|
|||||||
$subclassesWithoutBase,
|
$subclassesWithoutBase,
|
||||||
ClassInfo::subclassesFor('silverstripe\\core\\tests\\classinfotest\\baseclass', false)
|
ClassInfo::subclassesFor('silverstripe\\core\\tests\\classinfotest\\baseclass', false)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Check that core classes are present (eg: Email subclasses)
|
||||||
|
$emailClasses = ClassInfo::subclassesFor(\SilverStripe\Control\Email\Email::class);
|
||||||
|
$this->assertArrayHasKey(
|
||||||
|
'silverstripe\\control\\tests\\email\\emailtest\\emailsubclass',
|
||||||
|
$emailClasses,
|
||||||
|
'It contains : ' . json_encode($emailClasses)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testClassName()
|
public function testClassName()
|
||||||
|
Loading…
Reference in New Issue
Block a user