mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #11432 from creative-commoners/pulls/6/fix-definemethods
MNT Fix unit tests
This commit is contained in:
commit
662ac9d1f9
@ -511,7 +511,7 @@ trait Extensible
|
|||||||
// Setup all extension instances for this instance
|
// Setup all extension instances for this instance
|
||||||
$this->extension_instances = [];
|
$this->extension_instances = [];
|
||||||
foreach (ClassInfo::ancestry(static::class) as $class) {
|
foreach (ClassInfo::ancestry(static::class) as $class) {
|
||||||
if (in_array($class, self::$unextendable_classes)) {
|
if (in_array($class, self::class::$unextendable_classes)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES);
|
$extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES);
|
||||||
|
@ -391,7 +391,7 @@ class Deprecation
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Getting a backtrace is slow, so we only do it if we need it
|
// Getting a backtrace is slow, so we only do it if we need it
|
||||||
$backtrace = null;
|
$backtrace = [];
|
||||||
|
|
||||||
// Get the calling scope
|
// Get the calling scope
|
||||||
if ($scope == Deprecation::SCOPE_METHOD) {
|
if ($scope == Deprecation::SCOPE_METHOD) {
|
||||||
|
@ -111,8 +111,8 @@ class DeprecationTest extends SapphireTest
|
|||||||
'Will be removed without equivalent functionality to replace it.',
|
'Will be removed without equivalent functionality to replace it.',
|
||||||
'Called from SilverStripe\Dev\Tests\DeprecationTest->testNoticeNoReplacement.'
|
'Called from SilverStripe\Dev\Tests\DeprecationTest->testNoticeNoReplacement.'
|
||||||
]);
|
]);
|
||||||
$this->expectDeprecation();
|
$this->expectException(DeprecationTestException::class);
|
||||||
$this->expectDeprecationMessage($message);
|
$this->expectExceptionMessage($message);
|
||||||
$this->enableDeprecationNotices(true);
|
$this->enableDeprecationNotices(true);
|
||||||
$ret = $this->myDeprecatedMethodNoReplacement();
|
$ret = $this->myDeprecatedMethodNoReplacement();
|
||||||
$this->assertSame('abc', $ret);
|
$this->assertSame('abc', $ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user