@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' ) { |
|
| 4 | - die( 'Not an entry point' ); |
|
| 3 | +if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { |
|
| 4 | + die('Not an entry point'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -if ( !is_readable( $autoloaderClassPath = __DIR__ . '/../../SemanticMediaWiki/tests/autoloader.php' ) ) { |
|
| 8 | - die( 'The SemanticMediaWiki test autoloader is not available' ); |
|
| 7 | +if (!is_readable($autoloaderClassPath = __DIR__ . '/../../SemanticMediaWiki/tests/autoloader.php')) { |
|
| 8 | + die('The SemanticMediaWiki test autoloader is not available'); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -print sprintf( "\n%-20s%s\n", "Semantic Compound Queries: ", SCQ_VERSION ); |
|
| 11 | +print sprintf("\n%-20s%s\n", "Semantic Compound Queries: ", SCQ_VERSION); |
|
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @dataProvider i18nFileProvider |
| 19 | 19 | */ |
| 20 | - public function testI18NJsonDecodeEncode( $file ) { |
|
| 20 | + public function testI18NJsonDecodeEncode($file) { |
|
| 21 | 21 | |
| 22 | - $jsonFileReader = UtilityFactory::getInstance()->newJsonFileReader( $file ); |
|
| 22 | + $jsonFileReader = UtilityFactory::getInstance()->newJsonFileReader($file); |
|
| 23 | 23 | |
| 24 | 24 | $this->assertIsInt( |
| 25 | 25 | $jsonFileReader->getModificationTime() |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | $provider = []; |
| 36 | 36 | $location = $GLOBALS['wgMessagesDirs']['SemanticCompoundQueries']; |
| 37 | 37 | |
| 38 | - $bulkFileProvider = UtilityFactory::getInstance()->newBulkFileProvider( $location ); |
|
| 39 | - $bulkFileProvider->searchByFileExtension( 'json' ); |
|
| 38 | + $bulkFileProvider = UtilityFactory::getInstance()->newBulkFileProvider($location); |
|
| 39 | + $bulkFileProvider->searchByFileExtension('json'); |
|
| 40 | 40 | |
| 41 | - foreach ( $bulkFileProvider->getFiles() as $file ) { |
|
| 42 | - $provider[] = [ $file ]; |
|
| 41 | + foreach ($bulkFileProvider->getFiles() as $file) { |
|
| 42 | + $provider[] = [$file]; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $provider; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function testCanConstruct() { |
| 30 | 30 | |
| 31 | 31 | $instance = new CompoundQuery( |
| 32 | - $this->apiFactory->newApiMain( [ 'query' => 'Foo' ] ), |
|
| 32 | + $this->apiFactory->newApiMain(['query' => 'Foo']), |
|
| 33 | 33 | 'compoundquery' |
| 34 | 34 | ); |
| 35 | 35 | |
@@ -42,22 +42,22 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * @dataProvider sampleQueryProvider |
| 44 | 44 | */ |
| 45 | - public function testExecute( array $query, array $expected ) { |
|
| 45 | + public function testExecute(array $query, array $expected) { |
|
| 46 | 46 | |
| 47 | - $results = $this->apiFactory->doApiRequest( [ |
|
| 47 | + $results = $this->apiFactory->doApiRequest([ |
|
| 48 | 48 | 'action' => 'compoundquery', |
| 49 | - 'query' => implode( '|', $query ) |
|
| 50 | - ] ); |
|
| 49 | + 'query' => implode('|', $query) |
|
| 50 | + ]); |
|
| 51 | 51 | |
| 52 | 52 | $this->assertIsArray( |
| 53 | 53 | $results |
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | // If their is no printrequests array we expect an error array |
| 57 | - if ( isset( $results['query']['printrequests'] ) ) { |
|
| 58 | - $this->assertEquals( $expected, $results['query']['printrequests'] ); |
|
| 57 | + if (isset($results['query']['printrequests'])) { |
|
| 58 | + $this->assertEquals($expected, $results['query']['printrequests']); |
|
| 59 | 59 | } else { |
| 60 | - $this->assertArrayHasKey( 'error', $results ); |
|
| 60 | + $this->assertArrayHasKey('error', $results); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |