mediawiki-skins-Citizen/tests/phpunit/Partials/HeaderTest.php
H. C. Kruse 661ad61486
ci: add PHPUnit tests (#712)
* 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>
2023-08-25 14:39:37 -07:00

40 lines
1.1 KiB
PHP

<?php
declare( strict_types=1 );
namespace MediaWiki\Skins\Citizen\Tests\Partials;
use MediaWiki\Skins\Citizen\Partials\Header;
use MediaWiki\Skins\Citizen\SkinCitizen;
/**
* @group Citizen
*/
class HeaderTest extends \MediaWikiIntegrationTestCase {
/**
* @covers \MediaWiki\Skins\Citizen\Partials\Header::decorateSearchBoxData
* @return void
*/
public function testDecorateSearchBoxData() {
$partial = new Header( new SkinCitizen() );
$out = $partial->decorateSearchBoxData( [] );
$this->assertArrayHasKey( 'msg-citizen-search-toggle-shortcut', $out );
$this->assertEquals( '[/]', $out['msg-citizen-search-toggle-shortcut'] );
}
/**
* @covers \MediaWiki\Skins\Citizen\Partials\Header::getUserInfoData
* @covers \MediaWiki\Skins\Citizen\Partials\Header::getUserPageHTML
* @covers \MediaWiki\Skins\Citizen\Partials\Header::getUserGroupsHTML
* @covers \MediaWiki\Skins\Citizen\Partials\Header::getUserContributionsHTML
* @return void
*/
public function testGetUserInfoData() {
$partial = new Header( new SkinCitizen() );
$out = $partial->getUserInfoData( [] );
$this->assertArrayHasKey( 'id', $out );
}
}