/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Console/PromptsForMissingInputTest.php
48 строк
1 KB
Lucas Michot
[13.x] Prefer isEmpty()/isNotEmpty()/contains() over count() checks (#60978)
02 авг 2026, 23:33
Не верифицирован
02 авг 2026, 23:33
aabbcd0
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Console; use Illuminate\Console\Concerns\PromptsForMissingInput; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; class PromptsForMissingInputTest extends TestCase { public function testDidReceiveOptionsReturnsFalseWhenAllOptionsMatchTheirDefaults(): void { $stub = $this->makeStub(); $input = new ArrayInput([], $stub->getDefinition()); $this->assertFalse($stub->didReceiveOptions($input)); } public function testDidReceiveOptionsReturnsTrueWhenAnOptionDiffersFromItsDefault(): void { $stub = $this->makeStub(); $input = new ArrayInput(['--force' => true], $stub->getDefinition()); $this->assertTrue($stub->didReceiveOptions($input)); } protected function makeStub() { return new class { use PromptsForMissingInput { didReceiveOptions as public; } public function getDefinition(): InputDefinition { return new InputDefinition([ new InputOption('force', null, InputOption::VALUE_NONE), new InputOption('name', null, InputOption::VALUE_OPTIONAL, '', 'default-name'), ]); } }; } }