File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
tests/CPMDBTests/TestSuites/Mods Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace CPMDBTests \TestSuites \Mods ;
6+
7+ use CPMDB \Mods \Mod \Screenshots \ModScreenshotCollection ;
8+ use CPMDBTEsts \TestClasses \CPMDBTestCase ;
9+
10+ final class ScreenshotTests extends CPMDBTestCase
11+ {
12+ public function test_screenImageExists () : void
13+ {
14+ $ collection = $ this ->createCollection ()
15+ ->categoryClothing ()
16+ ->getByID ('clothing.catsuit ' )
17+ ->getScreenshotCollection ();
18+
19+ $ this ->assertTrue ($ collection ->hasScreenshots ());
20+ $ this ->assertSame (1 , $ collection ->countScreenshots ());
21+
22+ $ default = $ collection ->getDefault ();
23+ $ this ->assertTrue ($ default ->getImageFile ()->exists ());
24+ }
25+
26+ public function test_multiScreenshots () : void
27+ {
28+ $ collection = $ this ->createCollection ()
29+ ->categoryClothing ()
30+ ->getByID ('clothing.xrx-led-leotard ' )
31+ ->getScreenshotCollection ();
32+
33+ $ screens = $ collection ->getAll ();
34+
35+ $ this ->assertCount (2 , $ screens );
36+ $ this ->assertSame (ModScreenshotCollection::DEFAULT_ID , $ screens [0 ]->getID ());
37+ $ this ->assertTrue ($ screens [0 ]->isDefault ());
38+
39+ $ this ->assertSame ('nighttime ' , $ screens [1 ]->getID ());
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments