fix: expose S100 event traits to frontend
This commit is contained in:
@@ -184,6 +184,10 @@ class GameConstBase
|
|||||||
/** @var array 선택할 수 없으나 게임 내에 유효한 장수 내정 특기 */
|
/** @var array 선택할 수 없으나 게임 내에 유효한 장수 내정 특기 */
|
||||||
public static $optionalSpecialDomestic = [
|
public static $optionalSpecialDomestic = [
|
||||||
'None',
|
'None',
|
||||||
|
'che_event_귀병', 'che_event_신산', 'che_event_환술', 'che_event_집중', 'che_event_신중',
|
||||||
|
'che_event_반계', 'che_event_보병', 'che_event_궁병', 'che_event_기병', 'che_event_공성',
|
||||||
|
'che_event_돌격', 'che_event_무쌍', 'che_event_견고', 'che_event_위압', 'che_event_저격',
|
||||||
|
'che_event_필살', 'che_event_징병', 'che_event_의술', 'che_event_격노', 'che_event_척사',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var string 기본 전투 특기 */
|
/** @var string 기본 전투 특기 */
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use sammo\GameConst;
|
||||||
use sammo\GeneralPool\SPoolUnderU100;
|
use sammo\GeneralPool\SPoolUnderU100;
|
||||||
|
|
||||||
require_once __DIR__ . '/../hwe/sammo/AbsGeneralPool.php';
|
require_once __DIR__ . '/../hwe/sammo/AbsGeneralPool.php';
|
||||||
require_once __DIR__ . '/../hwe/sammo/AbsFromUserPool.php';
|
require_once __DIR__ . '/../hwe/sammo/AbsFromUserPool.php';
|
||||||
require_once __DIR__ . '/../hwe/sammo/GeneralPool/SPoolUnderU100.php';
|
require_once __DIR__ . '/../hwe/sammo/GeneralPool/SPoolUnderU100.php';
|
||||||
|
require_once __DIR__ . '/../hwe/sammo/ActionLogger.php';
|
||||||
|
require_once __DIR__ . '/../hwe/sammo/GameConstBase.php';
|
||||||
|
require_once __DIR__ . '/../hwe/d_setting/GameConst.php';
|
||||||
|
|
||||||
final class CentennialAllStarPoolTest extends TestCase
|
final class CentennialAllStarPoolTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -141,4 +145,31 @@ final class CentennialAllStarPoolTest extends TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testEveryHistoricalEventSpecialIsExposedToTheFrontend(): void
|
||||||
|
{
|
||||||
|
$pool = json_decode(
|
||||||
|
file_get_contents(self::POOL_PATH),
|
||||||
|
true,
|
||||||
|
512,
|
||||||
|
JSON_THROW_ON_ERROR
|
||||||
|
);
|
||||||
|
$column = array_flip($pool['columns']);
|
||||||
|
$registeredSpecials = array_flip(array_merge(
|
||||||
|
GameConst::$availableSpecialDomestic,
|
||||||
|
GameConst::$optionalSpecialDomestic
|
||||||
|
));
|
||||||
|
|
||||||
|
foreach ($pool['data'] as $row) {
|
||||||
|
$special = $row[$column['specialDomestic']];
|
||||||
|
if ($special === null || $special === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
self::assertArrayHasKey(
|
||||||
|
$special,
|
||||||
|
$registeredSpecials,
|
||||||
|
"{$special} must be included in GetConst iActionInfo.specialDomestic"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user