| 
									
										
										
										
											2019-10-03 19:43:53 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace PhpOffice\PhpSpreadsheetTests\Worksheet; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use PhpOffice\PhpSpreadsheet\Worksheet\ColumnDimension; | 
					
						
							|  |  |  | use PHPUnit\Framework\TestCase; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ColumnDimensionTest extends TestCase | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2020-05-18 04:49:57 +00:00
										 |  |  |     public function testInstantiateColumnDimensionDefault(): void | 
					
						
							| 
									
										
										
										
											2019-10-03 19:43:53 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         $expected = 'A'; | 
					
						
							|  |  |  |         $columnDimension = new ColumnDimension(); | 
					
						
							|  |  |  |         self::assertInstanceOf(ColumnDimension::class, $columnDimension); | 
					
						
							|  |  |  |         $result = $columnDimension->getColumnIndex(); | 
					
						
							|  |  |  |         self::assertEquals($expected, $result); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-18 04:49:57 +00:00
										 |  |  |     public function testGetAndSetColumnIndex(): void | 
					
						
							| 
									
										
										
										
											2019-10-03 19:43:53 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         $expected = 'B'; | 
					
						
							|  |  |  |         $columnDimension = new ColumnDimension(); | 
					
						
							|  |  |  |         $columnDimension->setColumnIndex($expected); | 
					
						
							|  |  |  |         $result = $columnDimension->getColumnIndex(); | 
					
						
							|  |  |  |         self::assertSame($expected, $result); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-18 04:49:57 +00:00
										 |  |  |     public function testGetAndSetWidth(): void | 
					
						
							| 
									
										
										
										
											2019-10-03 19:43:53 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         $expected = 1.2; | 
					
						
							|  |  |  |         $columnDimension = new ColumnDimension(); | 
					
						
							|  |  |  |         $columnDimension->setWidth($expected); | 
					
						
							|  |  |  |         $result = $columnDimension->getWidth(); | 
					
						
							|  |  |  |         self::assertSame($expected, $result); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-18 04:49:57 +00:00
										 |  |  |     public function testGetAndSetAutoSize(): void | 
					
						
							| 
									
										
										
										
											2019-10-03 19:43:53 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         $expected = true; | 
					
						
							|  |  |  |         $columnDimension = new ColumnDimension(); | 
					
						
							|  |  |  |         $columnDimension->setAutoSize($expected); | 
					
						
							|  |  |  |         $result = $columnDimension->getAutoSize(); | 
					
						
							|  |  |  |         self::assertSame($expected, $result); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |