@@ -29,6 +29,18 @@ class UserPasswordEncoderCommandTest extends AbstractWebTestCase
29
29
{
30
30
/** @var CommandTester */
31
31
private $ passwordEncoderCommandTester ;
32
+ private $ colSize ;
33
+
34
+ protected function setUp (): void
35
+ {
36
+ $ this ->colSize = getenv ('COLUMNS ' );
37
+ putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
38
+ }
39
+
40
+ protected function tearDown (): void
41
+ {
42
+ putenv ($ this ->colSize ? 'COLUMNS= ' .$ this ->colSize : 'COLUMNS ' );
43
+ }
32
44
33
45
public function testEncodePasswordEmptySalt ()
34
46
{
@@ -314,7 +326,6 @@ public function testThrowsExceptionOnNoConfiguredEncoders()
314
326
315
327
protected function setUp (): void
316
328
{
317
- putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
318
329
$ kernel = $ this ->createKernel (['test_case ' => 'PasswordEncode ' ]);
319
330
$ kernel ->boot ();
320
331
@@ -332,7 +343,6 @@ protected function tearDown(): void
332
343
333
344
private function setupArgon2i ()
334
345
{
335
- putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
336
346
$ kernel = $ this ->createKernel (['test_case ' => 'PasswordEncode ' , 'root_config ' => 'argon2i.yml ' ]);
337
347
$ kernel ->boot ();
338
348
@@ -345,7 +355,6 @@ private function setupArgon2i()
345
355
346
356
private function setupArgon2id ()
347
357
{
348
- putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
349
358
$ kernel = $ this ->createKernel (['test_case ' => 'PasswordEncode ' , 'root_config ' => 'argon2id.yml ' ]);
350
359
$ kernel ->boot ();
351
360
@@ -358,7 +367,6 @@ private function setupArgon2id()
358
367
359
368
private function setupBcrypt ()
360
369
{
361
- putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
362
370
$ kernel = $ this ->createKernel (['test_case ' => 'PasswordEncode ' , 'root_config ' => 'bcrypt.yml ' ]);
363
371
$ kernel ->boot ();
364
372
@@ -371,7 +379,6 @@ private function setupBcrypt()
371
379
372
380
private function setupSodium ()
373
381
{
374
- putenv ('COLUMNS= ' .(119 + \strlen (\PHP_EOL )));
375
382
$ kernel = $ this ->createKernel (['test_case ' => 'PasswordEncode ' , 'root_config ' => 'sodium.yml ' ]);
376
383
$ kernel ->boot ();
377
384
0 commit comments