aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiUnblockTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/api/ApiUnblockTest.php')
-rw-r--r--tests/phpunit/includes/api/ApiUnblockTest.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/phpunit/includes/api/ApiUnblockTest.php b/tests/phpunit/includes/api/ApiUnblockTest.php
index 062024a9f231..67dc3030efb2 100644
--- a/tests/phpunit/includes/api/ApiUnblockTest.php
+++ b/tests/phpunit/includes/api/ApiUnblockTest.php
@@ -1,7 +1,6 @@
<?php
use MediaWiki\Block\DatabaseBlock;
-use MediaWiki\MediaWikiServices;
/**
* @group API
@@ -33,7 +32,7 @@ class ApiUnblockTest extends ApiTestCase {
'address' => $this->blockee->getName(),
'by' => $this->blocker,
] );
- $result = MediaWikiServices::getInstance()->getDatabaseBlockStore()->insertBlock( $block );
+ $result = $this->getServiceContainer()->getDatabaseBlockStore()->insertBlock( $block );
$this->assertNotFalse( $result, 'Could not insert block' );
$blockFromDB = DatabaseBlock::newFromID( $result['id'] );
$this->assertTrue( $blockFromDB !== null, 'Could not retrieve block' );
@@ -99,7 +98,7 @@ class ApiUnblockTest extends ApiTestCase {
'address' => $this->blocker->getName(),
'by' => $this->getTestUser( 'sysop' )->getUser(),
] );
- MediaWikiServices::getInstance()->getDatabaseBlockStore()->insertBlock( $block );
+ $this->getServiceContainer()->getDatabaseBlockStore()->insertBlock( $block );
$this->doUnblock();
}
@@ -109,7 +108,7 @@ class ApiUnblockTest extends ApiTestCase {
'address' => $this->blocker->getName(),
'by' => $this->getTestUser( 'sysop' )->getUser(),
] );
- $result = MediaWikiServices::getInstance()->getDatabaseBlockStore()->insertBlock( $block );
+ $result = $this->getServiceContainer()->getDatabaseBlockStore()->insertBlock( $block );
$this->assertNotFalse( $result, 'Could not insert block' );
$this->doUnblock( [ 'user' => $this->blocker->getName() ] );