@@ -38,6 +38,37 @@ public function testRenderAllPagesIterable(): void
3838 self ::assertCount (38 , $ files );
3939 }
4040
41+ public function testGetPageSizeByIndex (): void
42+ {
43+ $ notice = $ this ->loadDocument ('notice ' );
44+ $ size = $ notice ->getPageSizeByIndex (0 );
45+ self ::assertSame (595 , (int )$ size ->width );
46+ self ::assertSame (841 , (int )$ size ->height );
47+
48+ $ badIndex = $ notice ->getPageSizeByIndex (-5 );
49+ self ::assertNull ($ badIndex );
50+
51+ $ badIndex2 = $ notice ->getPageSizeByIndex (1000 );
52+ self ::assertNull ($ badIndex2 );
53+ }
54+
55+ public function testPageSizeIterator ()
56+ {
57+ $ layout = [];
58+ $ notice = $ this ->loadDocument ('yolo ' );
59+ foreach ($ notice ->pageSizeIterator () as $ size ) {
60+ $ layout [] = [
61+ 'width ' => (int )$ size ->width ,
62+ 'height ' => (int )$ size ->height ,
63+ ];
64+ }
65+ self ::assertCount (36 , $ layout );
66+ foreach ($ layout as $ pageSize ) {
67+ self ::assertSame (595 , $ pageSize ['width ' ]);
68+ self ::assertSame (841 , $ pageSize ['height ' ]);
69+ }
70+ }
71+
4172 public function testSaveFlattenedCopy (): void
4273 {
4374 $ cerfaDoc = $ this ->loadDocument ('cerfa_13750-05 ' );
0 commit comments