1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SMW\Tests\Maintenance\Jobs; |
4
|
|
|
|
5
|
|
|
use SMW\Maintenance\MaintenanceFactory; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* @covers \SMW\Maintenance\MaintenanceFactory |
9
|
|
|
* @group semantic-mediawiki |
10
|
|
|
* |
11
|
|
|
* @license GNU GPL v2+ |
12
|
|
|
* @since 2.2 |
13
|
|
|
* |
14
|
|
|
* @author mwjames |
15
|
|
|
*/ |
16
|
|
|
class MaintenanceFactoryTest extends \PHPUnit_Framework_TestCase { |
17
|
|
|
|
18
|
|
|
private $store; |
19
|
|
|
|
20
|
|
|
protected function setUp() { |
21
|
|
|
parent::setUp(); |
22
|
|
|
|
23
|
|
|
$this->store = $this->getMockBuilder( '\SMW\Store' ) |
24
|
|
|
->disableOriginalConstructor() |
25
|
|
|
->getMockForAbstractClass(); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function testCanConstruct() { |
29
|
|
|
|
30
|
|
|
$this->assertInstanceOf( |
31
|
|
|
'\SMW\Maintenance\MaintenanceFactory', |
32
|
|
|
new MaintenanceFactory() |
33
|
|
|
); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function testCanConstructMaintenanceHelper() { |
37
|
|
|
|
38
|
|
|
$instance = new MaintenanceFactory(); |
39
|
|
|
|
40
|
|
|
$this->assertInstanceOf( |
41
|
|
|
'\SMW\Maintenance\MaintenanceHelper', |
42
|
|
|
$instance->newMaintenanceHelper() |
43
|
|
|
); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function testCanConstructDataRebuilder() { |
47
|
|
|
|
48
|
|
|
$instance = new MaintenanceFactory(); |
49
|
|
|
|
50
|
|
|
$this->assertInstanceOf( |
51
|
|
|
'\SMW\Maintenance\DataRebuilder', |
52
|
|
|
$instance->newDataRebuilder( $this->store ) |
53
|
|
|
); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function testCanConstructConceptCacheRebuilder() { |
57
|
|
|
|
58
|
|
|
$instance = new MaintenanceFactory(); |
59
|
|
|
|
60
|
|
|
$this->assertInstanceOf( |
61
|
|
|
'\SMW\Maintenance\ConceptCacheRebuilder', |
62
|
|
|
$instance->newConceptCacheRebuilder( $this->store ) |
63
|
|
|
); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function testCanConstructPropertyStatisticsRebuilder() { |
67
|
|
|
|
68
|
|
|
$instance = new MaintenanceFactory(); |
69
|
|
|
|
70
|
|
|
$this->assertInstanceOf( |
71
|
|
|
'\SMW\Maintenance\PropertyStatisticsRebuilder', |
72
|
|
|
$instance->newPropertyStatisticsRebuilder( $this->store ) |
73
|
|
|
); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function testCanConstructRebuildPropertyStatistics() { |
77
|
|
|
|
78
|
|
|
$instance = new MaintenanceFactory(); |
79
|
|
|
|
80
|
|
|
$this->assertInstanceOf( |
81
|
|
|
'\SMW\Maintenance\RebuildPropertyStatistics', |
82
|
|
|
$instance->newRebuildPropertyStatistics() |
83
|
|
|
); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
} |
87
|
|
|
|