summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/StoreTest.php
blob: def0c4c5309149ee9b07d673edba87ce88c78c63 (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
<?php

namespace SMW\Tests;

use SMW\DIWikiPage;

/**
 * @covers \SMW\Store
 * @group semantic-mediawiki
 *
 * @license GNU GPL v2+
 * @since 2.4
 *
 * @author mwjames
 */
class StoreTest extends \PHPUnit_Framework_TestCase {

	public function testGetRedirectTarget() {

		$wikipage = new DIWikiPage( 'Foo', NS_MAIN );
		$expected = new DIWikiPage( 'Bar', NS_MAIN );

		$instance = $this->getMockBuilder( '\SMW\Store' )
			->disableOriginalConstructor()
			->setMethods( [ 'getPropertyValues' ] )
			->getMockForAbstractClass();

		$instance->expects( $this->once() )
			->method( 'getPropertyValues' )
			->will( $this->returnValue( [ $expected ] ) );

		$this->assertEquals(
			$expected,
			$instance->getRedirectTarget( $wikipage )
		);
	}

}