Skip to content

Commit

Permalink
Add tests for environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Dec 9, 2023
1 parent 94203c0 commit aae7223
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/php/websocket/unittest/EnvironmentTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,21 @@ public function properties_from_directory() {
public function arguments($arguments) {
Assert::equals($arguments, (new Environment('dev', [], $arguments))->arguments());
}

#[Test]
public function env_variable() {
putenv('TEST=true');
Assert::equals('true', (new Environment('dev'))->variable('TEST'));
}

#[Test]
public function unset_variable() {
putenv('TEST');
Assert::null((new Environment('dev'))->variable('TEST'));
}

#[Test]
public function export_variable() {
Assert::equals('true', (new Environment('dev'))->export('TEST', 'true')->variable('TEST'));
}
}

0 comments on commit aae7223

Please sign in to comment.