@@ -93,16 +93,25 @@ private function setConfigAndSave(array $extras = []): void
9393 }
9494
9595 // =========================================================================
96- // SUBFILTERING_HANDLERS — always persisted unconditionally
96+ // SUBFILTERING_HANDLERS
9797 // =========================================================================
9898
9999 #[Test]
100- public function testSubfilteringHandlersIsAlwaysPersisted (): void
100+ public function testSubfilteringHandlersIsNotPersistedWhenEmptyJsonArray (): void
101101 {
102102 $ this ->setConfigAndSave ();
103103
104- $ this ->assertArrayHasKey (JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value , $ this ->capturedMetadata );
105- $ this ->assertSame ('[] ' , $ this ->capturedMetadata [JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value ]);
104+ $ this ->assertArrayNotHasKey (JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value , $ this ->capturedMetadata );
105+ }
106+
107+ #[Test]
108+ public function testSubfilteringHandlersIsNotPersistedWhenNull (): void
109+ {
110+ $ this ->setConfigAndSave ([
111+ JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value => null ,
112+ ]);
113+
114+ $ this ->assertArrayNotHasKey (JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value , $ this ->capturedMetadata );
106115 }
107116
108117 #[Test]
@@ -136,16 +145,15 @@ public function testBulkSetUsesCorrectJobIdAndPassword(): void
136145 }
137146
138147 // =========================================================================
139- // Empty project structure — only SUBFILTERING_HANDLERS persisted
148+ // Empty project structure — persists nothing
140149 // =========================================================================
141150
142151 #[Test]
143- public function testEmptyProjectStructureOnlyPersistsSubfilteringHandlers (): void
152+ public function testEmptyProjectStructurePersistsNothing (): void
144153 {
145154 $ this ->setConfigAndSave ();
146155
147- $ this ->assertCount (1 , $ this ->capturedMetadata );
148- $ this ->assertArrayHasKey (JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value , $ this ->capturedMetadata );
156+ $ this ->assertCount (0 , $ this ->capturedMetadata );
149157 }
150158
151159 // =========================================================================
@@ -377,6 +385,7 @@ public function testMetadataKeyOrderMatchesCodeOrder(): void
377385 'character_counter_mode ' => 'source ' ,
378386 'tm_prioritization ' => true ,
379387 'dialect_strict ' => ['it-IT ' => true ],
388+ JobsMetadataMarshaller::SUBFILTERING_HANDLERS ->value => json_encode ([['handler ' => 'xliff ' ]]),
380389 ]);
381390
382391 $ this ->assertSame ([
0 commit comments