mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
24 lines
571 B
PHP
24 lines
571 B
PHP
<?php
|
|
|
|
use Pest\Plugins\Environment;
|
|
|
|
test('environment is set to CI when --ci option is used', function () {
|
|
$previousName = Environment::name();
|
|
|
|
$plugin = new Environment();
|
|
|
|
$plugin->handleArguments(['foo', '--ci', 'bar']);
|
|
|
|
expect(Environment::name())->toBe(Environment::CI);
|
|
|
|
Environment::name($previousName);
|
|
});
|
|
|
|
test('environment is set to Local when --ci option is not used', function () {
|
|
$plugin = new Environment();
|
|
|
|
$plugin->handleArguments(['foo', 'bar', 'baz']);
|
|
|
|
expect(Environment::name())->toBe(Environment::LOCAL);
|
|
});
|