Doubles
3 weeks ago
Providers
3 weeks ago
BulkRearmOnGrowthTest.php
3 weeks ago
BulkReviewsUpdateStuckStateTest.php
3 weeks ago
ClearCacheRelayResetTest.php
3 weeks ago
DeleteSourceRelayFailureTest.php
3 weeks ago
ErrorHandlerFalsyOptionTest.php
3 weeks ago
FeedCacheUpdateServiceTest.php
3 weeks ago
FeedMalformedPayloadTest.php
3 weeks ago
ForceKeylessRefetchTest.php
3 weeks ago
LicenseDeactivateStaleStateTest.php
3 weeks ago
MediaFinderMemoTest.php
3 weeks ago
MultiSourceAggregationTest.php
3 weeks ago
ReconcileMigratedLicenseRoutineTest.php
3 weeks ago
ReconcileRemovalTest.php
3 weeks ago
RegisterWebsiteRoutineTest.php
3 weeks ago
RemoteRequestMemoTest.php
3 weeks ago
ReviewAlertHeaderTotalsTest.php
3 weeks ago
ReviewAlertPageTargetingTest.php
3 weeks ago
ReviewAlertStarFillTest.php
3 weeks ago
ShortcodeNeutralizationTest.php
3 weeks ago
SiteMigrationRecoveryTest.php
3 weeks ago
Smash1583HeaderParityTest.php
3 weeks ago
Smash1631MultiLanguageBulkTest.php
3 weeks ago
Smash1631UpdateSingleLangScopeTest.php
3 weeks ago
Smash1706TripAdvisorPlaceIdTest.php
3 weeks ago
Smash1756SchemaServiceTest.php
3 weeks ago
Smash1785AvatarLocalUrlGuardTest.php
3 weeks ago
Smash1785AvatarReHealTest.php
3 weeks ago
Smash1795ReviewTextXssTest.php
3 weeks ago
Smash782BookingHeaderRatingTest.php
3 weeks ago
Smash782CountryFlagEmojiTest.php
3 weeks ago
Smash782ExternalRefreshCronTest.php
3 weeks ago
Smash782ExtrasTemplateTest.php
3 weeks ago
Smash782ReviewAlertProviderDataTest.php
3 weeks ago
SourceIdLookupTest.php
3 weeks ago
WpmlGetCurrentLanguageTest.php
3 weeks ago
WpmlLanguageMappingTest.php
3 weeks ago
ReconcileRemovalTest.php
60 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SmashBalloon\Reviews\Tests\Unit; |
| 4 | |
| 5 | use PHPUnit\Framework\TestCase; |
| 6 | |
| 7 | /** |
| 8 | * Regression guard for the REMOVAL of the destructive relay source |
| 9 | * reconciliation (SMASH-1585 follow-up, 2026-06-24). |
| 10 | * |
| 11 | * The relay's source-reconcile endpoint treated an empty `place_ids` keep-list |
| 12 | * as "remove all". A single false-empty from the plugin (e.g. a transient |
| 13 | * `$wpdb` read error returning an empty set) on a routine Clear All Caches could |
| 14 | * therefore wipe EVERY relay-side source for a paying customer. The feature was |
| 15 | * non-essential — the SMASH-1585 migration fix is the bearer-aware register |
| 16 | * rebind, and the per-source delete path already keeps the relay in sync — so it |
| 17 | * was removed outright rather than guarded. |
| 18 | * |
| 19 | * These tests fail if anyone reintroduces the destructive call, forcing a |
| 20 | * deliberate re-review (explicit confirmed remove-all signal + cross-repo |
| 21 | * place_id/provider pinning) before a keep-list/diff reconcile can return. |
| 22 | */ |
| 23 | final class ReconcileRemovalTest extends TestCase |
| 24 | { |
| 25 | private static function saverSource(): string |
| 26 | { |
| 27 | $path = __DIR__ . '/../../class/Common/Builder/SBR_Feed_Saver_Manager.php'; |
| 28 | self::assertFileExists($path, 'SBR_Feed_Saver_Manager.php not found at expected path'); |
| 29 | |
| 30 | return (string) file_get_contents($path); |
| 31 | } |
| 32 | |
| 33 | public function test_reconcile_relay_sources_method_is_removed(): void |
| 34 | { |
| 35 | $this->assertStringNotContainsString( |
| 36 | 'function reconcile_relay_sources', |
| 37 | self::saverSource(), |
| 38 | 'The destructive reconcile_relay_sources() method must stay removed.' |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | public function test_plugin_never_posts_to_sources_reconcile(): void |
| 43 | { |
| 44 | $this->assertStringNotContainsString( |
| 45 | "->call('sources/reconcile'", |
| 46 | self::saverSource(), |
| 47 | 'The plugin must not POST to sources/reconcile — an empty keep-list wipes all relay sources.' |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | public function test_clear_all_caches_does_not_invoke_reconcile(): void |
| 52 | { |
| 53 | $this->assertStringNotContainsString( |
| 54 | 'self::reconcile_relay_sources()', |
| 55 | self::saverSource(), |
| 56 | 'clear_all_caches() must not call reconcile_relay_sources().' |
| 57 | ); |
| 58 | } |
| 59 | } |
| 60 |