| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function testExportTransactionLines(): void |
||
| 19 | { |
||
| 20 | $this->setCurrentUser('responsible'); |
||
| 21 | |||
| 22 | // Query to generate the Excel file on disk |
||
| 23 | $hostname = 'my-ichtus.lan'; |
||
| 24 | $qb = _em()->getRepository(TransactionLine::class)->createQueryBuilder('tl'); |
||
| 25 | $handler = new TransactionLines($hostname); |
||
| 26 | $result = $qb->getQuery()->getResult(); |
||
| 27 | |||
| 28 | $url = $handler->export($result); |
||
| 29 | |||
| 30 | $spreadsheet = $this->readExport($hostname, $url); |
||
| 31 | $sheet = $spreadsheet->getActiveSheet(); |
||
| 32 | |||
| 33 | // Test a few arbitrary data |
||
| 34 | self::assertSame('Date', $sheet->getCell('A1')->getCalculatedValue()); |
||
| 35 | self::assertSame('Pointé', $sheet->getCell('M1')->getCalculatedValue()); |
||
| 36 | self::assertSame('Inscription cours nautique Active Member', $sheet->getCell('C2')->getCalculatedValue()); |
||
| 37 | self::assertSame(45562.5, $sheet->getCell('L14')->getCalculatedValue()); |
||
| 38 | } |
||
| 40 |