Minor: MathDatabaseTest cleaning

* Remove unused constants
* Refactor deprecated wfGetDB

Change-Id: I926fbe59fd2fef9617da9870b8b9c2a6662f22df
This commit is contained in:
Moritz Schubotz (physikerwelt) 2022-08-26 18:23:06 +02:00
parent 580571e067
commit 7cae2517e5
No known key found for this signature in database
GPG key ID: F803DB146DDF36C3

View file

@ -20,10 +20,7 @@ class MathDatabaseTest extends MediaWikiIntegrationTestCase {
*/ */
private $renderer; private $renderer;
private const SOME_TEX = "a+b"; private const SOME_TEX = "a+b";
private const SOME_HTML = "a<sub>b</sub> and so on";
private const SOME_MATHML = "iℏ∂_tΨ=H^Ψ<mrow><\ci>"; private const SOME_MATHML = "iℏ∂_tΨ=H^Ψ<mrow><\ci>";
private const SOME_CONSERVATIVENESS = 2;
private const SOME_OUTPUTHASH = 'C65c884f742c8591808a121a828bc09f8<';
/** /**
* creates a new database connection and a new math renderer * creates a new database connection and a new math renderer
@ -33,11 +30,14 @@ class MathDatabaseTest extends MediaWikiIntegrationTestCase {
* $this->tablesUsed[] = 'math'; * $this->tablesUsed[] = 'math';
* } * }
* was not sufficient. * was not sufficient.
* @throws Exception
*/ */
protected function setUp(): void { protected function setUp(): void {
parent::setUp(); parent::setUp();
// TODO: figure out why this is necessary // TODO: figure out why this is necessary
$this->db = wfGetDB( DB_PRIMARY ); $this->db = $this->getServiceContainer()
->getDBLoadBalancer()
->getConnection( DB_PRIMARY );
$this->renderer = new MathMathML( self::SOME_TEX ); $this->renderer = new MathMathML( self::SOME_TEX );
$this->tablesUsed[] = 'mathoid'; $this->tablesUsed[] = 'mathoid';
} }