8000 [gha] Define COLUMNS properly · qurben/symfony@058168e · GitHub
[go: up one dir, main page]

Skip to content

Commit 058168e

Browse files
[gha] Define COLUMNS properly
This reverts commit c2e4ac6.
1 parent fdb8b9e commit 058168e

File tree

6 files changed

+32
-13
lines changed

6 files changed

+32
-13
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
COMPOSER_HOME="$(composer config home)"
6262
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
6363
64+
echo COLUMNS=120 >> $GITHUB_ENV
6465
echo PHPUNIT="$(readlink -f ./phpunit) --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
6566
echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV
6667
@@ -149,7 +150,6 @@ jobs:
149150
local ok=0
150151
local title="$1 $FLIP"
151152
local start=$(date -u +%s)
152-
export COLUMNS=120
153153
OUTPUT=$(bash -xc "$2" 2>&1) || ok=1
154154
local end=$(date -u +%s)
155155

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/TextDescriptorTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515

1616
class TextDescriptorTest extends AbstractDescriptorTest
1717
{
18+
private $colSize;
19+
1820
protected function setUp(): void
1921
{
20-
putenv('COLUMNS=121');
22+
$this->colSize = getenv('COLUMNS');
23+
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
2124
}
2225

2326
protected function tearDown(): void
2427
{
25-
putenv('COLUMNS');
28+
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
2629
}
2730

2831
protected function getDescriptor()

src/Symfony/Bundle/SecurityBundle/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

src/Symfony/Component/Form/Tests/Console/Descriptor/JsonDescriptorTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515

1616
class JsonDescriptorTest extends AbstractDescriptorTest
1717
{
18+
private $colSize;
19+
1820
protected function setUp(): void
1921
{
20-
putenv('COLUMNS=121');
22+
$this->colSize = getenv('COLUMNS');
23+
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
2124
}
2225

2326
protected function tearDown(): void
2427
{
25-
putenv('COLUMNS');
28+
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
2629
}
2730

2831
protected function getDescriptor()

src/Symfony/Component/Form/Tests/Console/Descriptor/TextDescriptorTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515

1616
class TextDescriptorTest extends AbstractDescriptorTest
1717
{
18+
private $colSize;
19+
1820
protected function setUp(): void
1921
{
20-
putenv('COLUMNS=121');
22+
$this->colSize = getenv('COLUMNS');
23+
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
2124
}
2225

2326
protected function tearDown(): void
2427
{
25-
putenv('COLUMNS');
28+
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
2629
}
2730

2831
protected function getDescriptor()

src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@
2727
*/
2828
class DebugCommandTest extends TestCase
2929
{
30+
private $colSize;
31+
3032
protected function setUp(): void
3133
{
34+
$this->colSize = getenv('COLUMNS');
3235
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
3336
}
3437

3538
protected function tearDown(): void
3639
{
37-
putenv('COLUMNS');
40+
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
3841
}
3942

4043
public function testOutput()

0 commit comments

Comments
 (0)
0