mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-12-02 09:57:45 +00:00
661ad61486
* ci: WIP add PHP Unit Tests
* ci: 👷 lint code to MediaWiki standards
Check commit and GitHub actions for more details
* ci: Add phpunit tests
---------
Co-authored-by: github-actions <github-actions@users.noreply.github.com>
50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare( strict_types=1 );
|
|
|
|
namespace MediaWiki\Skins\Citizen\Tests\Partials;
|
|
|
|
use MediaWiki\Skins\Citizen\Partials\PageTitle;
|
|
use MediaWiki\Skins\Citizen\SkinCitizen;
|
|
use MediaWiki\Title\Title;
|
|
use MediaWikiIntegrationTestCase;
|
|
use MWException;
|
|
use RequestContext;
|
|
|
|
/**
|
|
* @group Citizen
|
|
*/
|
|
class PageTitleTest extends MediaWikiIntegrationTestCase {
|
|
/**
|
|
* @covers \MediaWiki\Skins\Citizen\Partials\PageTitle
|
|
* @return void
|
|
* @throws MWException
|
|
*/
|
|
public function testDecorateTitleNoParenthesis() {
|
|
$title = Title::makeTitle( NS_PROJECT, 'Foo' );
|
|
RequestContext::resetMain();
|
|
RequestContext::getMain()->setTitle( $title );
|
|
$partial = new PageTitle( new SkinCitizen() );
|
|
|
|
$text = $partial->decorateTitle( 'Foo Title (paren)' );
|
|
|
|
$this->assertStringNotContainsString( 'mw-page-title-parenthesis', $text );
|
|
}
|
|
|
|
/**
|
|
* @covers \MediaWiki\Skins\Citizen\Partials\PageTitle
|
|
* @return void
|
|
* @throws MWException
|
|
*/
|
|
public function testDecorateTitle() {
|
|
$title = Title::makeTitle( NS_MAIN, 'Foo' );
|
|
RequestContext::resetMain();
|
|
RequestContext::getMain()->setTitle( $title );
|
|
$partial = new PageTitle( new SkinCitizen() );
|
|
|
|
$text = $partial->decorateTitle( 'Foo Title (paren)' );
|
|
|
|
$this->assertStringContainsString( 'mw-page-title-parenthesis', $text );
|
|
}
|
|
}
|