summaryrefslogtreecommitdiff
path: root/bin/wiki/vendor/addwiki/mediawiki-datamodel/tests/LogListTest.php
blob: 1098a8a6a8619bd67659a467524c515188a6cf08 (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
<?php

namespace Mediawiki\DataModel\Test;

use Mediawiki\DataModel\Log;
use Mediawiki\DataModel\LogList;
use Mediawiki\DataModel\PageIdentifier;

/**
 * @covers \Mediawiki\DataModel\LogList
 * @author Addshore
 */
class LogListTest extends \PHPUnit_Framework_TestCase {

	public function testJsonRoundTrip() {
		$logList = new LogList( array(
			new Log( 1, 'ty', 'ac', '2014', 'Addshore', new PageIdentifier( null, 22 ), 'comment', array() ),
			new Log( 2, 'ty2', 'ac2', '2015', 'Addbot', new PageIdentifier( null, 33 ), 'comment2', array() ),
		) );
		$json = $logList->jsonSerialize();
		$json = json_decode( json_encode( $json ), true );
		$this->assertEquals( $logList, LogList::jsonDeserialize( $json ) );
	}

}