@@ -97,6 +97,32 @@ public function testHandlingResponseWithInvalidUtf8(?ClientInterface $httpClient
9797 $ this ->assertInstanceOf (TextResult::class, $ result );
9898 }
9999
100+ /**
101+ * @dataProvider provideHttpClient
102+ */
103+ public function testTagHandlingVersion (?ClientInterface $ httpClient )
104+ {
105+ $ this ->needsRealServer ();
106+ $ translator = $ this ->makeTranslator ([TranslatorOptions::HTTP_CLIENT => $ httpClient ]);
107+ $ text = '<p>Hello world</p> ' ;
108+
109+ $ resultV1 = $ translator ->translateText ($ text , 'en ' , 'de ' , [
110+ TranslateTextOptions::TAG_HANDLING => 'html ' ,
111+ TranslateTextOptions::TAG_HANDLING_VERSION => 'v1 ' ,
112+ ]);
113+ $ this ->assertInstanceOf (TextResult::class, $ resultV1 );
114+ $ this ->assertNotNull ($ resultV1 ->text );
115+ $ this ->assertNotEmpty ($ resultV1 ->text );
116+
117+ $ resultV2 = $ translator ->translateText ($ text , 'en ' , 'de ' , [
118+ TranslateTextOptions::TAG_HANDLING => 'html ' ,
119+ TranslateTextOptions::TAG_HANDLING_VERSION => 'v2 ' ,
120+ ]);
121+ $ this ->assertInstanceOf (TextResult::class, $ resultV2 );
122+ $ this ->assertNotNull ($ resultV2 ->text );
123+ $ this ->assertNotEmpty ($ resultV2 ->text );
124+ }
125+
100126 /**
101127 * @dataProvider provideHttpClient
102128 */
0 commit comments