Skip to content

Commit

Permalink
MNT Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 22, 2024
1 parent ba97de9 commit 983e90b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Core/Extensible.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public function getExtensionInstances()
// Setup all extension instances for this instance
$this->extension_instances = [];
foreach (ClassInfo::ancestry(static::class) as $class) {
if (in_array($class, self::$unextendable_classes)) {
if (in_array($class, self::class::$unextendable_classes)) {
continue;
}
$extensions = Config::inst()->get($class, 'extensions', Config::UNINHERITED | Config::EXCLUDE_EXTRA_SOURCES);
Expand Down
2 changes: 1 addition & 1 deletion src/Dev/Deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public static function notice($atVersion, $string = '', $scope = Deprecation::SC
}

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

// Get the calling scope
if ($scope == Deprecation::SCOPE_METHOD) {
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Dev/DeprecationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public function testNoticeNoReplacement()
'Will be removed without equivalent functionality to replace it.',
'Called from SilverStripe\Dev\Tests\DeprecationTest->testNoticeNoReplacement.'
]);
$this->expectDeprecation();
$this->expectDeprecationMessage($message);
$this->expectException(DeprecationTestException::class);
$this->expectExceptionMessage($message);
$this->enableDeprecationNotices(true);
$ret = $this->myDeprecatedMethodNoReplacement();
$this->assertSame('abc', $ret);
Expand Down

0 comments on commit 983e90b

Please sign in to comment.