summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Utils/Mock/FakeQueryStore.php
blob: 306f66ce3fe2c2a73d3df8d7ddeeb3b50fcda41b (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
42
<?php

namespace SMW\Tests\Utils\Mock;

use SMW\QueryEngine;
use SMW\Store;
use SMW\StoreAware;
use SMWQuery;
use SMWQueryResult;

/**
 * FIXME One would wish to have a FakeStore but instead SMWSQLStore3 is used in
 * order to avoid to implement all abstract methods specified by SMW\Store
 *
 * @group SMW
 * @group SMWExtension
 * @group medium
 * @group semantic-mediawiki-integration
 * @group mediawiki-databaseless
 *
 * @license GNU GPL v2+
 * @since   1.9.2
 *
 * @author mwjames
 */
class FakeQueryStore implements QueryEngine, StoreAware {

	protected $store;

	public function setQueryResult( SMWQueryResult $queryResult ) {
		$this->queryResult = $queryResult;
	}

	public function setStore( Store $store ) {
		$this->store = $store;
	}

	// @codingStandardsIgnoreStart phpcs, ignore --sniffs=Generic.CodeAnalysis.UnusedFunctionParameter
	public function getQueryResult( SMWQuery $query ) { // @codingStandardsIgnoreEnd
		return $this->store->getQueryResult( $query );
	}
}