foreach ($cast as $c) {
expect($c)->toBeA('string');
}
});
it("casts boolean", function () {
$commandLine = new CommandLine();
$cast = $commandLine->cast(["true", "false", "some_string", null, 10], "boolean");
expect($cast)->toBeAn('array');
expect(count($cast))->toBe(5);
list($bTrue, $bFalse, $string, $null, $number) = $cast;
expect($bTrue)->toBeA('boolean')->toBe(true);
expect($bFalse)->toBeA('boolean')->toBe(false);
expect($string)->toBeA('boolean')->toBe(true);
expect($null)->toBeA('boolean')->toBe(false);
expect($number)->toBeA('boolean')->toBe(true);
});
it("casts numeric", function () {
$commandLine = new CommandLine();
$cast = $commandLine->cast([true, "false", "some_string", null, 10], "numeric");
expect($cast)->toBeAn('array');
expect(count($cast))->toBe(5);
expect(implode($cast))->toBe("100110");
});
it("casts value into array", function () {
$commandLine = new CommandLine();
$cast = $commandLine->cast("string", "string", true);
expect($cast)->toBeA("array");
expect($cast)->toContain("string");
});
});
});