@@ -25,11 +25,6 @@ public function setUp(): void
2525 /**
2626 * @covers EnvironmentSetCommand::setEnvVariable
2727 * @dataProvider setEnvVariableDataProvider
28- *
29- * @param string $originalEnvFileContent
30- * @param string $key
31- * @param string $value
32- * @param string $expectedNewEnvFile
3328 */
3429 public function testSetEnvVariable (
3530 string $ originalEnvFileContent ,
@@ -62,15 +57,24 @@ public function testSetEnvVariableTestOfNestedKeys(): void
6257 $ this ->assertEquals ($ expectedEnv , $ newEnv );
6358 }
6459
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+
6573 /**
6674 * @covers EnvironmentSetCommand::readKeyValuePair
6775 * @dataProvider readKeyValuePairDataProvider
68- *
69- * @param string $envFileContent
70- * @param string $key
71- * @param string|null $expectedKeyValuePair
7276 */
73- public function testReadKeyValuePair (string $ envFileContent , string $ key , ?string $ expectedKeyValuePair ): void
77+ public function testReadKeyValuePair (string $ envFileContent , string $ key , ?string $ expectedKeyValuePair = null ): void
7478 {
7579 $ realPair = $ this ->command ->readKeyValuePair ($ envFileContent , $ key );
7680 $ this ->assertEquals ($ expectedKeyValuePair , $ realPair );
@@ -92,9 +96,6 @@ public function testParseCommandArguments(array $params, array $expectedResult):
9296 /**
9397 * @covers EnvironmentSetCommand::assertKeyIsValid
9498 * @dataProvider assertKeyIsValidDataProvider
95- *
96- * @param string $key
97- * @param bool $isGood
9899 */
99100 public function testAssertKeyIsValid (string $ key , bool $ isGood ): void
100101 {
0 commit comments