Skip to content

Commit 4b2a008

Browse files
committed
Added tests for the screenshots.
1 parent ca5d8ab commit 4b2a008

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

0 commit comments

Comments
 (0)