| 8 | use Psr\Log\NullLogger; |
| 9 | |
| 10 | class ExternalCsvTest extends TestCase |
| 11 | { |
| 12 | private ExternalCsv $csv; |
| 13 | |
| 14 | protected function setUp(): void |
| 15 | { |
| 16 | $variableService = $this->createMock(VariableService::class); |
| 17 | $this->csv = new ExternalCsv('uid', new FakeL10N(), new NullLogger(), $variableService); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @dataProvider delimiterProvider |
| 22 | */ |
| 23 | public function testDetectDelimiter(string $row, string $expected): void |
| 24 | { |
| 25 | $ref = new \ReflectionMethod(ExternalCsv::class, 'detectDelimiter'); |
| 26 | $this->assertSame($expected, $ref->invoke($this->csv, $row)); |
| 27 | } |
| 28 | |
| 29 | public function delimiterProvider(): array |
| 30 | { |
| 31 | return [ |
| 32 | ['a,b,c', ','], |
| 33 | ['a;b;c', ';'], |
| 34 | ['a|b|c', '|'], |
| 35 | ["a\tb\tc", "\t"], |
| 36 | ]; |
| 37 | } |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected