sofa1at / mobiscrollinterpreter
将 sofa 1 的营业时间表转换为 mobiscroll 无效/有效对象
1.4.0.2
2022-08-31 07:41 UTC
Requires
- netresearch/jsonmapper: ^3
- scssphp/scssphp: 1.10.0
- sofa1at/php.b.core: ^1.9.0.22
Requires (Dev)
- phpunit/phpunit: ^9
README
使用 composer 安装 mobiscroll
{
"require": {
"sofa1at/php.b.int.mobiscroll": "^1"
},
"config": {
"github-oauth": {
"github.com": "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"
}
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:sofa1at/php.b.int.mobiscroll.git"
}
]
}
php-mobiscrollinterpreter
此存储库包含所有与 PSR-3 相关的接口/类/特性。
composer require sofa1at/mobiscrollinterpreter
$converter = new Sofa1MobiscrollConverter(); // add businesshours $converter->AddBusinessHours($mockDataBusinessHours); // add timesettings $converter->AddTimeSetting($mockTimeSetting); // receive json $converter->ToString();
#phpunit 测试 测试输出字符串是否与模拟数据字符串相等。
测试文件夹
测试类 InterpreterTest(interpretertest.php)
// timeSettings with Holidays testTimeSettingsAndBusinessHolidays(); // timeSettings only testTimeSettings(); // businessHours only testBusinessHours(); // businessHours with Holidays testBusinessHoursAndBusinessHolidays();