Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 399
Zeile 3... Zeile 3...
3
namespace Illuminate\Foundation\Console;
3
namespace Illuminate\Foundation\Console;
Zeile 4... Zeile 4...
4
 
4
 
5
use Illuminate\Console\GeneratorCommand;
5
use Illuminate\Console\GeneratorCommand;
6
use Illuminate\Support\Str;
6
use Illuminate\Support\Str;
-
 
7
use Symfony\Component\Console\Attribute\AsCommand;
7
use Symfony\Component\Console\Attribute\AsCommand;
8
use Symfony\Component\Console\Input\InputInterface;
-
 
9
use Symfony\Component\Console\Input\InputOption;
Zeile 8... Zeile 10...
8
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Output\OutputInterface;
9
 
11
 
10
#[AsCommand(name: 'make:test')]
12
#[AsCommand(name: 'make:test')]
11
class TestMakeCommand extends GeneratorCommand
13
class TestMakeCommand extends GeneratorCommand
Zeile 118... Zeile 120...
118
            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists'],
120
            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists'],
119
            ['unit', 'u', InputOption::VALUE_NONE, 'Create a unit test'],
121
            ['unit', 'u', InputOption::VALUE_NONE, 'Create a unit test'],
120
            ['pest', 'p', InputOption::VALUE_NONE, 'Create a Pest test'],
122
            ['pest', 'p', InputOption::VALUE_NONE, 'Create a Pest test'],
121
        ];
123
        ];
122
    }
124
    }
-
 
125
 
-
 
126
    /**
-
 
127
     * Interact further with the user if they were prompted for missing arguments.
-
 
128
     *
-
 
129
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
-
 
130
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
-
 
131
     * @return void
-
 
132
     */
-
 
133
    protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
-
 
134
    {
-
 
135
        if ($this->didReceiveOptions($input)) {
-
 
136
            return;
-
 
137
        }
-
 
138
 
-
 
139
        $type = $this->components->choice('Which type of test would you like', [
-
 
140
            'feature',
-
 
141
            'unit',
-
 
142
            'pest feature',
-
 
143
            'pest unit',
-
 
144
        ], default: 0);
-
 
145
 
-
 
146
        match ($type) {
-
 
147
            'feature' => null,
-
 
148
            'unit' => $input->setOption('unit', true),
-
 
149
            'pest feature' => $input->setOption('pest', true),
-
 
150
            'pest unit' => tap($input)->setOption('pest', true)->setOption('unit', true),
-
 
151
        };
-
 
152
    }
123
}
153
}