Skip to content

Commit

Permalink
Use helper method instead of eval
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 23, 2024
1 parent df9e43f commit 1c26ddb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/test/php/lang/unittest/CommandLineTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

class CommandLineTest {

/** @return iterable */
private function implementations() {
yield [CommandLine::$UNIX];
yield [CommandLine::$WINDOWS];
}

#[Test]
public function forWindows() {
Assert::equals(CommandLine::$WINDOWS, CommandLine::forName('Windows'));
Expand Down Expand Up @@ -266,12 +272,12 @@ public function evalCommandLineWindowsTripleClosedBySingle() {
);
}

#[Test, Values(eval: 'CommandLine::values()')]
#[Test, Values(from: 'implementations')]
public function resolve_non_existant($impl) {
Assert::false($impl->resolve('@non-existant@')->valid());
}

#[Test, Values(eval: 'CommandLine::values()')]
#[Test, Values(from: 'implementations')]
public function resolve_empty($impl) {
Assert::false($impl->resolve('')->valid());
}
Expand Down

0 comments on commit 1c26ddb

Please sign in to comment.