mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
Improve license validation form accessibility/line-ending consistency and correct legacy test intent (#3673)
* Initial plan * chore: outline plan for requested fixes * fix license form accessibility and legacy test cleanup --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
This commit is contained in:
1 parent
83801fc02c
commit
d1a5f23e4d
4 files changed
+20
-26
No files matched your search
Vendored
Whitespace-only changes.
@@ -57,61 +57,61 @@
|
||||
<div class="col-12">
|
||||
<label class="form-label">{{ 'Validate IP'|trans }}</label>
|
||||
<div class="d-flex flex-wrap gap-3 pt-1 mb-2">
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateIPYes">
|
||||
<input type="radio" class="form-check-input" name="validate_ip" id="validateIPYes" value="1"{% if service.validate_ip %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'Yes'|trans }}</span>
|
||||
</label>
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateIPNo">
|
||||
<input type="radio" class="form-check-input" name="validate_ip" id="validateIPNo" value="0"{% if not service.validate_ip %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'No'|trans }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea class="form-control" name="ips" rows="3" placeholder="{{ 'One IP address per line'|trans }}">{% for value in service.ips %}{{ value }}{{ constant('PHP_EOL') }}{% endfor %}</textarea>
|
||||
<textarea class="form-control" name="ips" rows="3" placeholder="{{ 'One IP address per line'|trans }}">{% for value in service.ips %}{{ value }}{{ "\n" }}{% endfor %}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label">{{ 'Validate Host'|trans }}</label>
|
||||
<div class="d-flex flex-wrap gap-3 pt-1 mb-2">
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateHostYes">
|
||||
<input type="radio" class="form-check-input" name="validate_host" id="validateHostYes" value="1"{% if service.validate_host %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'Yes'|trans }}</span>
|
||||
</label>
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateHostNo">
|
||||
<input type="radio" class="form-check-input" name="validate_host" id="validateHostNo" value="0"{% if not service.validate_host %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'No'|trans }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea class="form-control" name="hosts" rows="3" placeholder="{{ 'One host per line'|trans }}">{% for value in service.hosts %}{{ value }}{{ constant('PHP_EOL') }}{% endfor %}</textarea>
|
||||
<textarea class="form-control" name="hosts" rows="3" placeholder="{{ 'One host per line'|trans }}">{% for value in service.hosts %}{{ value }}{{ "\n" }}{% endfor %}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label">{{ 'Validate Path'|trans }}</label>
|
||||
<div class="d-flex flex-wrap gap-3 pt-1 mb-2">
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validatePathYes">
|
||||
<input type="radio" class="form-check-input" name="validate_path" id="validatePathYes" value="1"{% if service.validate_path %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'Yes'|trans }}</span>
|
||||
</label>
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validatePathNo">
|
||||
<input type="radio" class="form-check-input" name="validate_path" id="validatePathNo" value="0"{% if not service.validate_path %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'No'|trans }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea class="form-control" name="paths" rows="3" placeholder="{{ 'One path per line'|trans }}">{% for value in service.paths %}{{ value }}{{ constant('PHP_EOL') }}{% endfor %}</textarea>
|
||||
<textarea class="form-control" name="paths" rows="3" placeholder="{{ 'One path per line'|trans }}">{% for value in service.paths %}{{ value }}{{ "\n" }}{% endfor %}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label">{{ 'Validate Version'|trans }}</label>
|
||||
<div class="d-flex flex-wrap gap-3 pt-1 mb-2">
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateVerYes">
|
||||
<input type="radio" class="form-check-input" name="validate_version" id="validateVerYes" value="1"{% if service.validate_version %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'Yes'|trans }}</span>
|
||||
</label>
|
||||
<label class="form-check">
|
||||
<label class="form-check" for="validateVerNo">
|
||||
<input type="radio" class="form-check-input" name="validate_version" id="validateVerNo" value="0"{% if not service.validate_version %} checked{% endif %}>
|
||||
<span class="form-check-label">{{ 'No'|trans }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea class="form-control" name="versions" rows="3" placeholder="{{ 'One version per line'|trans }}">{% for value in service.versions %}{{ value }}{{ constant('PHP_EOL') }}{% endfor %}</textarea>
|
||||
<textarea class="form-control" name="versions" rows="3" placeholder="{{ 'One version per line'|trans }}">{% for value in service.versions %}{{ value }}{{ "\n" }}{% endfor %}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,8 +84,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$this->service->setDi($di);
|
||||
|
||||
$this->expectException(\FOSSBilling\Exception::class);
|
||||
$result = $this->service->validateOrderData($data);
|
||||
$this->assertNull($result);
|
||||
$this->service->validateOrderData($data);
|
||||
}
|
||||
|
||||
public static function validateOrderDateTransferExceptionsProvider(): array
|
||||
@@ -157,8 +156,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$serviceMock->setDi($di);
|
||||
|
||||
$this->expectException(\FOSSBilling\Exception::class);
|
||||
$result = $serviceMock->validateOrderData($data);
|
||||
$this->assertNull($result);
|
||||
$serviceMock->validateOrderData($data);
|
||||
}
|
||||
|
||||
public static function validateOrderDateRegisterExceptionsProvider(): array
|
||||
@@ -536,9 +534,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$order->client_id = 1;
|
||||
|
||||
$this->expectException(\FOSSBilling\Exception::class);
|
||||
$result = $this->service->action_renew($order);
|
||||
|
||||
$this->assertTrue($result);
|
||||
$this->service->action_renew($order);
|
||||
}
|
||||
|
||||
public function testActionSuspend(): void
|
||||
@@ -612,9 +608,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$order->client_id = 1;
|
||||
|
||||
$this->expectException(\FOSSBilling\Exception::class);
|
||||
$result = $this->service->action_cancel($order);
|
||||
|
||||
$this->assertTrue($result);
|
||||
$this->service->action_cancel($order);
|
||||
}
|
||||
|
||||
public function testActionUncancel(): void
|
||||
@@ -1242,7 +1236,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$di = $this->getDi();
|
||||
$di['mod_service'] = $di->protect(fn ($name): \PHPUnit\Framework\MockObject\MockObject => $systemServiceMock);
|
||||
$di['db'] = $dbMock;
|
||||
$di['logger'] = $di['logger'] = $this->createMock('Box_Log');
|
||||
$di['logger'] = $this->createMock('Box_Log');
|
||||
$serviceMock->setDi($di);
|
||||
|
||||
$result = $serviceMock->batchSyncExpirationDates();
|
||||
|
||||
@@ -17,7 +17,7 @@ final class ServiceTest extends \BBTestCase
|
||||
$this->service = new Service();
|
||||
}
|
||||
|
||||
public static function validateOrdertDataProvider(): array
|
||||
public static function validateOrderDataProvider(): array
|
||||
{
|
||||
return [
|
||||
['server_id', 'Hosting product is not configured completely. Configure server for hosting product.', 701],
|
||||
@@ -27,7 +27,7 @@ final class ServiceTest extends \BBTestCase
|
||||
];
|
||||
}
|
||||
|
||||
#[DataProvider('validateOrdertDataProvider')]
|
||||
#[DataProvider('validateOrderDataProvider')]
|
||||
public function testValidateOrderData(string $field, string $exceptionMessage, int $excCode): void
|
||||
{
|
||||
$data = [
|
||||
@@ -1145,7 +1145,7 @@ final class ServiceTest extends \BBTestCase
|
||||
|
||||
public function testGetHpSearchQuery(): void
|
||||
{
|
||||
$result = $this->service->getServersSearchQuery([]);
|
||||
$result = $this->service->getHpSearchQuery([]);
|
||||
$this->assertIsString($result[0]);
|
||||
$this->assertIsArray($result[1]);
|
||||
$this->assertSame([], $result[1]);
|
||||
|
||||
Reference in new issue
Block a user