We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a0685f commit 39ec2c9Copy full SHA for 39ec2c9
tests/Feature/SQLLoaderTest.php
@@ -210,3 +210,23 @@
210
->toContain('"EMAIL"')
211
->toContain(')');
212
});
213
+
214
+test('it can set the default date format', function () {
215
+ Process::fake();
216
217
+ $loader = new SQLLoader();
218
+ $loader->inFile(__DIR__.'/../data/filler.dat')
219
+ ->as('users.ctl')
220
+ ->dateFormat('YYYY-MM-DD')
221
+ ->withHeaders()
222
+ ->into('users')
223
+ ->execute();
224
225
+ $controlFile = $loader->buildControlFile();
226
227
+ expect($controlFile)->toBeString()
228
+ ->toContain("DATE FORMAT 'YYYY-MM-DD'\n")
229
+ ->toContain("TIMESTAMP FORMAT 'YYYY-MM-DD'\n")
230
+ ->toContain("TIMESTAMP WITH TIME ZONE 'YYYY-MM-DD'\n")
231
+ ->toContain("TIMESTAMP WITH LOCAL TIME ZONE 'YYYY-MM-DD'\n");
232
+});
0 commit comments