1 | <?php |
||
16 | class CachedReferenceListOutputRendererTest extends \PHPUnit_Framework_TestCase { |
||
17 | |||
18 | private $referenceListOutputRenderer; |
||
19 | private $contextInteractor; |
||
20 | private $namespaceExaminer; |
||
21 | private $cache; |
||
22 | private $cacheKeyProvider; |
||
23 | |||
24 | protected function setUp() { |
||
46 | |||
47 | public function testCanConstruct() { |
||
48 | |||
49 | $this->assertInstanceOf( |
||
50 | '\SCI\CachedReferenceListOutputRenderer', |
||
51 | new CachedReferenceListOutputRenderer( |
||
52 | $this->referenceListOutputRenderer, |
||
53 | $this->contextInteractor, |
||
54 | $this->namespaceExaminer, |
||
55 | $this->cache, |
||
56 | $this->cacheKeyProvider |
||
57 | ) |
||
58 | ); |
||
59 | } |
||
60 | |||
61 | public function testUnmodifiedTextForNotEnabledSemanticNamespace() { |
||
62 | |||
63 | $this->contextInteractor->expects( $this->once() ) |
||
64 | ->method( 'getTitle' ) |
||
65 | ->will( $this->returnValue( \Title::newFromText( __METHOD__ ) ) ); |
||
66 | |||
67 | $this->contextInteractor->expects( $this->once() ) |
||
68 | ->method( 'hasAction' ) |
||
69 | ->will( $this->returnValue( true ) ); |
||
70 | |||
71 | $this->namespaceExaminer->expects( $this->once() ) |
||
72 | ->method( 'isSemanticEnabled' ) |
||
73 | ->will( $this->returnValue( false ) ); |
||
74 | |||
75 | $instance = new CachedReferenceListOutputRenderer( |
||
76 | $this->referenceListOutputRenderer, |
||
77 | $this->contextInteractor, |
||
78 | $this->namespaceExaminer, |
||
79 | $this->cache, |
||
80 | $this->cacheKeyProvider |
||
81 | ); |
||
82 | |||
83 | $text = ''; |
||
84 | $instance->addReferenceListToText( $text ); |
||
85 | |||
86 | $this->assertEmpty( |
||
87 | $text |
||
88 | ); |
||
89 | } |
||
90 | |||
91 | public function testRemovalOfPlaceholderForDisabledReferencelist() { |
||
113 | |||
114 | public function testNoAutoReferencelistOnFileNamespace() { |
||
115 | |||
142 | |||
143 | } |
||
144 |