summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/tests/phpunit/MockMessageCollectionForExport.php
blob: 0f260f858c8a697cc6db9bc5e213b71cff857603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
 * Mock class for unit tests
 * @author Niklas Laxström
 * @file
 * @copyright Copyright © 2012-2013, Niklas Laxström
 * @license GPL-2.0-or-later
 */

/**
 * This class can be used to test exporting of message groups.
 */
class MockMessageCollectionForExport extends MessageCollection {
	public function __construct() {
		$msg = new FatMessage( 'translatedmsg', 'definition' );
		$msg->setTranslation( 'translation' );
		$this->messages['translatedmsg'] = $msg;

		$msg = new FatMessage( 'fuzzymsg', 'definition' );
		$msg->addTag( 'fuzzy' );
		$msg->setTranslation( '!!FUZZY!!translation' );
		$this->messages['fuzzymsg'] = $msg;

		$msg = new FatMessage( 'untranslatedmsg', 'definition' );
		$this->messages['untranslatedmsg'] = $msg;

		$this->tags = [
			'fuzzy' => [ 'fuzzymsg' ],
		];

		$this->keys = array_flip( array_keys( $this->messages ) );
	}

	public function getAuthors() {
		return [ 'Nike the bunny' ];
	}

	public function getLanguage() {
		return 'fi';
	}
}