wiki.techinc.nl/tests/phpunit/unit/includes/CommentFormatter/CommentParserFactoryTest.php
Timo Tijhof 0ca2b996b7 CommentFormatter: Clean up CommentParserFactoryTest
* Widen `@covers` annotation to at least the subject class.
  Ref https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/982945
  Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:%2522Widen%2522

* Remove useless test for private properties existing, which
  is implementation detail of no interest to whether the class is
  working correctly or not.

* Given no assertions exist, combine testCreate()

This commit removes use of deprecated assertObjectHasAttribute, hence
tagging as T342110.

Bug: T342110
Needed-By: Id708a7716505ffce26c8eb438a98d74195682e91
Change-Id: Id7a7593b41afef89fd02af070bdf760baddd2c30
2024-02-13 19:13:37 +00:00

56 lines
1.9 KiB
PHP

<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
*/
namespace MediaWiki\Tests\Unit\CommentFormatter;
use Language;
use LinkCache;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\CommentFormatter\CommentParser;
use MediaWiki\CommentFormatter\CommentParserFactory;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Title\NamespaceInfo;
use MediaWiki\Title\TitleParser;
use MediaWikiUnitTestCase;
use RepoGroup;
/**
* @group CommentFormatter
* @covers \MediaWiki\CommentFormatter\CommentParserFactory
*/
class CommentParserFactoryTest extends MediaWikiUnitTestCase {
public function testCreate() {
$factory = new CommentParserFactory(
$this->createMock( LinkRenderer::class ),
$this->createMock( LinkBatchFactory::class ),
$this->createMock( LinkCache::class ),
$this->createMock( RepoGroup::class ),
$this->createMock( Language::class ),
$this->createMock( Language::class ),
$this->createMock( TitleParser::class ),
$this->createMock( NamespaceInfo::class ),
$this->createMock( HookContainer::class )
);
$this->assertInstanceOf( CommentParser::class, $factory->create() );
}
}