| 
									
										
										
										
											2018-05-20 10:52:53 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace PhpOffice\PhpSpreadsheetTests\Helper; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use PhpOffice\PhpSpreadsheet\Helper\Html; | 
					
						
							|  |  |  | use PHPUnit\Framework\TestCase; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class HtmlTest extends TestCase | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerUtf8EncodingSupport | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param mixed $expected | 
					
						
							|  |  |  |      * @param mixed $input | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2020-05-18 04:49:57 +00:00
										 |  |  |     public function testUtf8EncodingSupport($expected, $input): void | 
					
						
							| 
									
										
										
										
											2018-05-20 10:52:53 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         $html = new Html(); | 
					
						
							|  |  |  |         $actual = $html->toRichTextObject($input); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self::assertSame($expected, $actual->getPlainText()); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function providerUtf8EncodingSupport() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return [ | 
					
						
							|  |  |  |             ['foo', 'foo'], | 
					
						
							|  |  |  |             ['können', 'können'], | 
					
						
							|  |  |  |             ['русский', 'русский'], | 
					
						
							|  |  |  |             ["foo\nbar", '<p>foo</p><p>bar</p>'], | 
					
						
							|  |  |  |         ]; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |