create(DemoCommand::class); $this->assertInstanceOf(DemoCommand::class, $command); } public function testCreateShell() { $factory = new CommandFactory(); $shell = $factory->create(SampleShell::class); $this->assertInstanceOf(SampleShell::class, $shell); } public function testInvalid() { $factory = new CommandFactory(); $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Class `Cake\Test\TestCase\Console\CommandFactoryTest` must be an instance of `Cake\Console\Shell` or `Cake\Console\Command`.'); $factory->create(static::class); } }