improv
This commit is contained in:
parent
66c4c1fe4f
commit
2c2e34b71e
42 changed files with 910 additions and 939 deletions
|
@ -1,12 +1,14 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Entity\SystemConfig;
|
||||
use App\Enum\SystemSettingKey;
|
||||
use App\Service\Config\AppName;
|
||||
use App\Service\Config\LowStockMultiplier;
|
||||
use App\Service\ConfigurationService;
|
||||
|
||||
test('AppName returns system name from configuration', function () {
|
||||
test('AppName returns system name from configuration', function (): void {
|
||||
// Arrange
|
||||
$appName = $this->getContainer()->get(AppName::class);
|
||||
$configService = $this->getContainer()->get(ConfigurationService::class);
|
||||
|
@ -16,13 +18,13 @@ test('AppName returns system name from configuration', function () {
|
|||
$configService->setConfigValue(SystemSettingKey::SYSTEM_NAME, $testSystemName);
|
||||
|
||||
// Act
|
||||
$result = (string)$appName;
|
||||
$result = (string) $appName;
|
||||
|
||||
// Assert
|
||||
expect($result)->toBe($testSystemName);
|
||||
});
|
||||
|
||||
test('AppName returns default system name when not configured', function () {
|
||||
test('AppName returns default system name when not configured', function (): void {
|
||||
// Arrange
|
||||
$appName = $this->getContainer()->get(AppName::class);
|
||||
$configService = $this->getContainer()->get(ConfigurationService::class);
|
||||
|
@ -31,13 +33,13 @@ test('AppName returns default system name when not configured', function () {
|
|||
$configService->setDefaultValue(SystemSettingKey::SYSTEM_NAME);
|
||||
|
||||
// Act
|
||||
$result = (string)$appName;
|
||||
$result = (string) $appName;
|
||||
|
||||
// Assert
|
||||
expect($result)->toBe(SystemConfig::DEFAULT_SYSTEM_NAME);
|
||||
});
|
||||
|
||||
test('LowStockMultiplier returns multiplier from configuration', function () {
|
||||
test('LowStockMultiplier returns multiplier from configuration', function (): void {
|
||||
// Arrange
|
||||
$lowStockMultiplier = $this->getContainer()->get(LowStockMultiplier::class);
|
||||
$configService = $this->getContainer()->get(ConfigurationService::class);
|
||||
|
@ -50,10 +52,10 @@ test('LowStockMultiplier returns multiplier from configuration', function () {
|
|||
$result = $lowStockMultiplier->getValue();
|
||||
|
||||
// Assert
|
||||
expect($result)->toBe((float)$testMultiplier);
|
||||
expect($result)->toBe((float) $testMultiplier);
|
||||
});
|
||||
|
||||
test('LowStockMultiplier returns default multiplier when not configured', function () {
|
||||
test('LowStockMultiplier returns default multiplier when not configured', function (): void {
|
||||
// Arrange
|
||||
$lowStockMultiplier = $this->getContainer()->get(LowStockMultiplier::class);
|
||||
$configService = $this->getContainer()->get(ConfigurationService::class);
|
||||
|
@ -65,10 +67,10 @@ test('LowStockMultiplier returns default multiplier when not configured', functi
|
|||
$result = $lowStockMultiplier->getValue();
|
||||
|
||||
// Assert
|
||||
expect($result)->toBe((float)SystemConfig::DEFAULT_STOCK_LOW_MULTIPLIER);
|
||||
expect($result)->toBe((float) SystemConfig::DEFAULT_STOCK_LOW_MULTIPLIER);
|
||||
});
|
||||
|
||||
test('LowStockMultiplier converts string value to float', function () {
|
||||
test('LowStockMultiplier converts string value to float', function (): void {
|
||||
// Arrange
|
||||
$lowStockMultiplier = $this->getContainer()->get(LowStockMultiplier::class);
|
||||
$configService = $this->getContainer()->get(ConfigurationService::class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue