@@ -25,11 +25,6 @@ public function setUp(): void
25
25
/**
26
26
* @covers EnvironmentSetCommand::setEnvVariable
27
27
* @dataProvider setEnvVariableDataProvider
28
- *
29
- * @param string $originalEnvFileContent
30
- * @param string $key
31
- * @param string $value
32
- * @param string $expectedNewEnvFile
33
28
*/
34
29
public function testSetEnvVariable (
35
30
string $ originalEnvFileContent ,
@@ -62,15 +57,24 @@ public function testSetEnvVariableTestOfNestedKeys(): void
62
57
$ this ->assertEquals ($ expectedEnv , $ newEnv );
63
58
}
64
59
60
+ /**
61
+ * @covers EnvironmentSetCommand::setEnvVariable
62
+ */
63
+ public function testWhitespaceAsValueDoesntCreateNewEntry (): void
64
+ {
65
+ $ env = 'APP_KEY = \t ' . "\n" ;
66
+
67
+ $ expectedEnv = 'APP_KEY=test ' . "\n" ;
68
+
69
+ [$ newEnv , $ _ ] = $ this ->command ->setEnvVariable ($ env , 'APP_KEY ' , 'test ' );
70
+ $ this ->assertEquals ($ expectedEnv , $ newEnv );
71
+ }
72
+
65
73
/**
66
74
* @covers EnvironmentSetCommand::readKeyValuePair
67
75
* @dataProvider readKeyValuePairDataProvider
68
- *
69
- * @param string $envFileContent
70
- * @param string $key
71
- * @param string|null $expectedKeyValuePair
72
76
*/
73
- public function testReadKeyValuePair (string $ envFileContent , string $ key , ?string $ expectedKeyValuePair ): void
77
+ public function testReadKeyValuePair (string $ envFileContent , string $ key , ?string $ expectedKeyValuePair = null ): void
74
78
{
75
79
$ realPair = $ this ->command ->readKeyValuePair ($ envFileContent , $ key );
76
80
$ this ->assertEquals ($ expectedKeyValuePair , $ realPair );
@@ -92,9 +96,6 @@ public function testParseCommandArguments(array $params, array $expectedResult):
92
96
/**
93
97
* @covers EnvironmentSetCommand::assertKeyIsValid
94
98
* @dataProvider assertKeyIsValidDataProvider
95
- *
96
- * @param string $key
97
- * @param bool $isGood
98
99
*/
99
100
public function testAssertKeyIsValid (string $ key , bool $ isGood ): void
100
101
{
0 commit comments