Completed
Push — master ( 981814...5ed881 )
by Jeroen De
236:00 queued 133:09
created

SpreadsheetTest::getFormats()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SRF\Tests\Unit\Formats;
4
5
use SMW\Test\QueryPrinterRegistryTestCase;
6
use SRF\SpreadsheetPrinter;
7
8
/**
9
 * @ingroup SemanticResultFormats
10
 * @ingroup Test
11
 * @group SRF
12
 * @group SMWExtension
13
 * @group ResultPrinters
14
 */
15
class SpreadsheetTest extends QueryPrinterRegistryTestCase {
16
17
	public function getFormats() {
18
		return [ 'spreadsheet' ];
19
	}
20
21
	public function getClass() {
22
		return 'SRF\SpreadsheetPrinter';
23
	}
24
25
	public function testLink() {
26
27
		$link = $this->getMockBuilder( '\SMWInfolink' )
28
			->disableOriginalConstructor()
29
			->getMock();
30
31
		$queryResult = $this->getMockBuilder( '\SMWQueryResult' )
32
			->disableOriginalConstructor()
33
			->getMock();
34
35
		$queryResult->expects( $this->once() )
36
			->method( 'getQueryLink' )
37
			->will( $this->returnValue( $link ) );
38
39
		$queryResult->expects( $this->any() )
40
			->method( 'getCount' )
41
			->will( $this->returnValue( 1 ) );
42
43
		$queryResult->expects( $this->any() )
44
			->method( 'getErrors' )
45
			->will( $this->returnValue( [] ) );
46
47
		$instance = new SpreadsheetPrinter( 'csv' );
48
		$instance->getResult( $queryResult, [], SMW_OUTPUT_WIKI );
49
	}
50
51
}
52