Skip to content

Commit dde38bc

Browse files
[gha] Define COLUMNS properly
This reverts commit c2e4ac613ca5dfcc60cc56f492ee04b52f010e4d.
1 parent b6d2b43 commit dde38bc

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ class UserPasswordEncoderCommandTest extends AbstractWebTestCase
2929
{
3030
/** @var CommandTester */
3131
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+
}
3244

3345
public function testEncodePasswordEmptySalt()
3446
{
@@ -314,7 +326,6 @@ public function testThrowsExceptionOnNoConfiguredEncoders()
314326

315327
protected function setUp(): void
316328
{
317-
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
318329
$kernel = $this->createKernel(['test_case' => 'PasswordEncode']);
319330
$kernel->boot();
320331

@@ -332,7 +343,6 @@ protected function tearDown(): void
332343

333344
private function setupArgon2i()
334345
{
335-
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
336346
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml']);
337347
$kernel->boot();
338348

@@ -345,7 +355,6 @@ private function setupArgon2i()
345355

346356
private function setupArgon2id()
347357
{
348-
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
349358
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2id.yml']);
350359
$kernel->boot();
351360

@@ -358,7 +367,6 @@ private function setupArgon2id()
358367

359368
private function setupBcrypt()
360369
{
361-
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
362370
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'bcrypt.yml']);
363371
$kernel->boot();
364372

@@ -371,7 +379,6 @@ private function setupBcrypt()
371379

372380
private function setupSodium()
373381
{
374-
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
375382
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'sodium.yml']);
376383
$kernel->boot();
377384

0 commit comments

Comments
 (0)