summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2015-08-14 20:11:52 +0200
committerAlex Legler <alex@a3li.li>2015-08-14 20:11:52 +0200
commit406658484ac434d75d47d082a907937aa2366ad1 (patch)
tree5071d7e22c8e43837be6912edcf726522c1c80a6 /SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php
parentIgnore Widget's compiled templates (diff)
downloadextensions-406658484ac434d75d47d082a907937aa2366ad1.tar.gz
extensions-406658484ac434d75d47d082a907937aa2366ad1.tar.bz2
extensions-406658484ac434d75d47d082a907937aa2366ad1.zip
Remove extensions that will be pulled in via composer
Diffstat (limited to 'SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php')
-rw-r--r--SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php150
1 files changed, 0 insertions, 150 deletions
diff --git a/SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php b/SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php
deleted file mode 100644
index 9942b41c..00000000
--- a/SemanticMediaWiki/tests/phpunit/includes/storage/CacheableResultCollectorTest.php
+++ /dev/null
@@ -1,150 +0,0 @@
-<?php
-
-namespace SMW\Test;
-
-use SMW\SimpleDictionary;
-
-use SMWRequestOptions;
-
-/**
- * @covers \SMW\Store\CacheableResultCollector
- *
- * @ingroup Test
- *
- * @group SMW
- * @group SMWExtension
- *
- * @licence GNU GPL v2+
- * @since 1.9
- *
- * @author mwjames
- */
-class CacheableResultCollectorTest extends SemanticMediaWikiTestCase {
-
- /**
- * @return string|false
- */
- public function getClass() {
- return '\SMW\Store\CacheableResultCollector';
- }
-
- /**
- * @since 1.9
- *
- * @return CacheableResultCollector
- */
- private function getInstance( $doCollect = array(), $cacheSetup = array() ) {
-
- $collector = $this->newMockBuilder()->newObject( 'CacheableResultCollector', array(
- 'runCollector' => $doCollect,
- 'cacheSetup' => new SimpleDictionary( $cacheSetup )
- ) );
-
- return $collector;
- }
-
- /**
- * @since 1.9
- */
- public function testConstructor() {
- $this->assertInstanceOf( $this->getClass(), $this->getInstance() );
- }
-
- /**
- * @dataProvider resultDataProvider
- *
- * @since 1.9
- */
- public function testGetResults( $setup, $expected ) {
-
- $instance = $this->getInstance( $setup['test'], $setup['cacheSetup'] );
- $instance->setRequestOptions( new SMWRequestOptions() );
-
- $result = $instance->getResults();
-
- $this->assertInternalType( 'array', $result );
- $this->assertInternalType( $expected['cacheDate'], $instance->getCacheDate() );
- $this->assertEquals( $expected['isCached'], $instance->isCached() );
- $this->assertEquals( $expected['result'], $result );
- $this->assertEquals( $expected['count'], $instance->getCount() );
-
- }
-
- /**
- * @var array
- */
- public function resultDataProvider() {
-
- $provider = array();
-
- $result = array( $this->newRandomString() );
-
- // #0 Non-cached scenario
- $provider[] = array(
- array(
- 'test' => $result,
- 'cacheSetup' => array(
- 'id' => rand(),
- 'type' => false,
- 'enabled' => false,
- 'expiry' => 100,
- )
- ),
- array(
- 'result' => $result,
- 'cacheDate' => 'null',
- 'isCached' => false,
- 'count' => count( $result )
- )
- );
-
- // #1 Cached scenario
- $id = rand();
- $result = array( $this->newRandomString(), $this->newRandomString() );
-
- $provider[] = array(
- array(
- 'test' => $result,
- 'cacheSetup' => array(
- 'id' => $id,
- 'type' => 'hash',
- 'enabled' => true,
- 'expiry' => 100,
- )
- ),
- array(
- 'result' => $result,
- 'cacheDate' => 'null',
- 'isCached' => false,
- 'count' => count( $result )
- )
- );
-
- // #2 Initialized with a different 'nonRelevant' set, id is kept
- // the same and results are expected to be equal with the previous
- // initialization (cached results)
- $nonRelevant = array( 'Lula' );
-
- $provider[] = array(
- array(
- 'test' => $nonRelevant,
- 'cacheSetup' => array(
- 'id' => $id,
- 'type' => 'hash',
- 'enabled' => true,
- 'expiry' => 100,
- )
- ),
- array(
- 'result' => $result,
- 'cacheDate' => 'string',
- 'isCached' => true,
- 'count' => count( $result )
- )
- );
-
- return $provider;
-
- }
-
-}