Page MenuHomeWickedGov Phorge

CampaignTypeTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

CampaignTypeTest.php

<?php
/**
* @group Fundraising
* @group CentralNotice
* @covers CampaignType::getId
* @covers CampaignType::getOnForAll
* @covers CampaignType::getMessageKey
* @covers CampaignType::getPreferenceKey
*/
class CampaignTypeTest extends MediaWikiUnitTestCase {
private CampaignType $campaignType;
protected function setUp(): void {
parent::setUp();
$this->campaignType = new CampaignType(
'testtype',
false
);
}
public function testGetId() {
$id = $this->campaignType->getId();
$this->assertSame( 'testtype', $id );
}
public function testGetOnForAll() {
$onForAll = $this->campaignType->getOnForAll();
$this->assertSame( false, $onForAll );
}
public function testGetMessageKey() {
// Coordinate with CampaignType::MESSAGE_KEY_PREFIX
$this->assertSame( 'centralnotice-campaign-type-testtype',
$this->campaignType->getMessageKey() );
}
public function testGetPreferenceKey() {
// Coordinate with CampaignType::PREFERENCE_KEY_PREFIX
$this->assertSame( 'centralnotice-display-campaign-type-testtype',
$this->campaignType->getPreferenceKey() );
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 20:51 (4 d, 23 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
27/88/5a737668dc573b9743b5ca686813
Default Alt Text
CampaignTypeTest.php (1 KB)

Event Timeline