mediawiki-extensions-Math/tests/phpunit/unit/InputCheckFactoryTest.php
Moritz Schubotz (physikerwelt) 707ad58598 Add MathCheckerFactory Service
Use WANObjectCache rather than genuine DB tables for greater
flexibility.

Note, this commit is the second step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214

Bug: T252390
Change-Id: Ifa7d943875f05088ef697a5a18ad292342a9b4ad
2020-05-27 07:29:49 +02:00

43 lines
1.1 KiB
PHP

<?php
use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
use MediaWiki\Extension\Math\InputCheck\MathoidChecker;
/**
* @covers MediaWiki\Extension\Math\InputCheck\InputCheckFactory
*/
class InputCheckFactoryTest extends MediaWikiUnitTestCase {
use FactoryArgTestTrait;
protected static function getFactoryClass() {
return InputCheckFactory::class;
}
protected static function getInstanceClass() {
return MathoidChecker::class;
}
protected static function getExtraClassArgCount() {
return 2;
}
/**
* This is required since the FactoryArgTestTrait uses the full classname.
* Testing without overwriting this function would result in
*
* ReflectionException: Method MediaWiki\Extension\Math\InputCheck\InputCheckFactory::
* newMediaWiki\Extension\Math\InputCheck\MathoidChecker() does not exist
*
* see T253613
* @return string
*/
protected function getFactoryMethodName() {
return 'new' . ( new \ReflectionClass( MathoidChecker::class ) )->getShortName();
}
protected function setUp():void {
parent::setUp();
$this->markTestSkipped( 'FactoryArgTestTrait can not yet handle the parameter numbers.' );
}
}