PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / trunk
ووسلام – همگام سازی ووکامرس و باسلام vtrunk
1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 1.8.7 1.8.4 1.7.6 All 50 releases
sync-basalam / tests / Services / ForceUpdateGateTest.php

ForceUpdateGateTest.php in ووسلام – همگام سازی ووکامرس و باسلام trunk, at tests/Services/ForceUpdateGateTest.php

35 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SyncBasalam\Tests\Services;
4
5 use PHPUnit\Framework\TestCase;
6 use SyncBasalam\Services\ForceUpdateGate;
7
8 class ForceUpdateGateTest extends TestCase
9 {
10 public function testDoesNotBlockWhenForceUpdateIsDisabled(): void
11 {
12 self::assertFalse(ForceUpdateGate::shouldBlock(false, '1.10.15', '1.10.15'));
13 }
14
15 public function testBlocksTheVersionThatReceivedTheForceUpdateFlag(): void
16 {
17 self::assertTrue(ForceUpdateGate::shouldBlock(true, '1.10.15', '1.10.15'));
18 }
19
20 public function testAllowsANewerPackageToRecoverFromTheStoredFlag(): void
21 {
22 self::assertFalse(ForceUpdateGate::shouldBlock(true, '1.10.15', '1.10.16'));
23 }
24
25 public function testIgnoresUnknownHotfixVersionReportedAsForcedByTheApi(): void
26 {
27 self::assertFalse(ForceUpdateGate::shouldHonorRemoteFlag(true, '1.10.16', '1.10.14'));
28 }
29
30 public function testHonorsForceUpdateForAnOutdatedPublishedVersion(): void
31 {
32 self::assertTrue(ForceUpdateGate::shouldHonorRemoteFlag(true, '1.10.13', '1.10.14'));
33 }
34 }
35