Skip to content

Commit 662ac9d

Browse files
Merge pull request #11432 from creative-commoners/pulls/6/fix-definemethods
MNT Fix unit tests
2 parents 8e08b1c + 983e90b commit 662ac9d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Core/Extensible.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public function getExtensionInstances()
511511
// Setup all extension instances for this instance
512512
$this->extension_instances = [];
513513
foreach (ClassInfo::ancestry(static::class) as $class) {
514-
if (in_array($class, self::$unextendable_classes)) {
514+
if (in_array($class, self::class::$unextendable_classes)) {
515515
continue;
516516
}
517517
$extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES);

src/Dev/Deprecation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public static function notice($atVersion, $string = '', $scope = Deprecation::SC
391391
}
392392

393393
// Getting a backtrace is slow, so we only do it if we need it
394-
$backtrace = null;
394+
$backtrace = [];
395395

396396
// Get the calling scope
397397
if ($scope == Deprecation::SCOPE_METHOD) {

tests/php/Dev/DeprecationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public function testNoticeNoReplacement()
111111
'Will be removed without equivalent functionality to replace it.',
112112
'Called from SilverStripe\Dev\Tests\DeprecationTest->testNoticeNoReplacement.'
113113
]);
114-
$this->expectDeprecation();
115-
$this->expectDeprecationMessage($message);
114+
$this->expectException(DeprecationTestException::class);
115+
$this->expectExceptionMessage($message);
116116
$this->enableDeprecationNotices(true);
117117
$ret = $this->myDeprecatedMethodNoReplacement();
118118
$this->assertSame('abc', $ret);

0 commit comments

Comments
 (0)