10
10
11
11
namespace chillerlan \ImagetilerTest ;
12
12
13
- use chillerlan \Imagetiler \Imagetiler ;
14
- use chillerlan \Imagetiler \ImagetilerOptions ;
13
+ use chillerlan \Imagetiler \{Imagetiler , ImagetilerOptions };
15
14
use PHPUnit \Framework \TestCase ;
16
15
use ReflectionClass , ReflectionMethod ;
17
16
@@ -23,21 +22,21 @@ protected function setUp():void{
23
22
$ this ->reflection = new ReflectionClass (Imagetiler::class);
24
23
}
25
24
26
- public function testGetSize (){
27
-
25
+ public function testGetSize (): void {
26
+ $ min = 0 ;
28
27
$ max = 22 ;
29
28
30
29
$ options = new ImagetilerOptions ([
31
- 'zoom_min ' => 0 ,
30
+ 'zoom_min ' => $ min ,
32
31
'zoom_max ' => $ max ,
33
32
'zoom_normalize ' => 4 ,
34
33
]);
35
34
36
35
$ tiler = new Imagetiler ($ options );
37
36
38
- for ($ z = 0 ; $ z <= $ max ; $ z ++){
37
+ for ($ z = $ min ; $ z <= $ max ; $ z ++){
39
38
$ v = $ this ->getMethod ('getSize ' )->invokeArgs ($ tiler , [4096 , 2048 , $ z ]);
40
-
39
+ /** @phan-suppress-next-line PhanPowerOfZero */
41
40
$ expected = 2 ** $ z * 256 ;
42
41
43
42
$ this ->assertSame ($ expected , $ v [0 ]);
@@ -51,7 +50,7 @@ public function testGetSize(){
51
50
*
52
51
* @return \ReflectionMethod
53
52
*/
54
- protected function getMethod (string $ method ):ReflectionMethod {
53
+ protected function getMethod (string $ method ):ReflectionMethod {
55
54
$ method = $ this ->reflection ->getMethod ($ method );
56
55
$ method ->setAccessible (true );
57
56
0 commit comments