|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * Copyright © Magento, Inc. All rights reserved. |
4 | | - * See COPYING.txt for license details. |
| 3 | + * Copyright 2014 Adobe |
| 4 | + * All Rights Reserved. |
5 | 5 | */ |
6 | 6 | declare(strict_types=1); |
7 | 7 |
|
@@ -124,36 +124,39 @@ public function testGetSourceFileMissing() |
124 | 124 | } |
125 | 125 |
|
126 | 126 | /** |
127 | | - * @param string $content |
128 | | - * |
129 | | - * @dataProvider getContentDataProvider |
| 127 | + * @return void |
130 | 128 | */ |
131 | | - public function testGetContent($content) |
| 129 | + public function testGetContentRegularRead(): void |
132 | 130 | { |
133 | | - $this->source->expects($this->exactly(2)) |
| 131 | + $content = 'some content here'; |
| 132 | + $this->source->expects($this->once()) |
134 | 133 | ->method('getContent') |
135 | 134 | ->with($this->object) |
136 | 135 | ->willReturn($content); |
137 | 136 | $this->assertEquals($content, $this->object->getContent()); |
138 | | - $this->assertEquals($content, $this->object->getContent()); // no in-memory caching for content |
139 | 137 | } |
140 | 138 |
|
141 | 139 | /** |
142 | | - * @return array |
| 140 | + * @return void |
143 | 141 | */ |
144 | | - public static function getContentDataProvider() |
| 142 | + public function testGetContentWithRetries(): void |
145 | 143 | { |
146 | | - return [ |
147 | | - 'normal content' => ['content'], |
148 | | - 'empty content' => [''], |
149 | | - ]; |
| 144 | + $content = 'some content here'; |
| 145 | + $this->source->expects($this->exactly(3)) |
| 146 | + ->method('getContent') |
| 147 | + ->with($this->object) |
| 148 | + ->willReturnOnConsecutiveCalls('', false, $content); |
| 149 | + $this->assertEquals($content, $this->object->getContent()); |
150 | 150 | } |
151 | 151 |
|
152 | | - public function testGetContentNotFound() |
| 152 | + /** |
| 153 | + * @return void |
| 154 | + */ |
| 155 | + public function testGetContentNotFound(): void |
153 | 156 | { |
154 | 157 | $this->expectException('Magento\Framework\View\Asset\File\NotFoundException'); |
155 | 158 | $this->expectExceptionMessage('Unable to get content for \'Magento_Module/dir/file.css\''); |
156 | | - $this->source->expects($this->once()) |
| 159 | + $this->source->expects($this->exactly(3)) |
157 | 160 | ->method('getContent') |
158 | 161 | ->with($this->object) |
159 | 162 | ->willReturn(false); |
|
0 commit comments