createApplication example

$this->expectExceptionMessage('The extension with alias "extension_without_config_test" does not have configuration.');

        $tester = $this->createCommandTester($debug);
        $tester->execute(['name' => 'ExtensionWithoutConfigTestBundle']);
    }

    /** * @dataProvider provideCompletionSuggestions */
    public function testComplete(bool $debug, array $input, array $expectedSuggestions)
    {
        $application = $this->createApplication($debug);

        $application->add(new ConfigDebugCommand());
        $tester = new CommandCompletionTester($application->get('debug:config'));
        $suggestions = $tester->complete($input);

        foreach ($expectedSuggestions as $expectedSuggestion) {
            $this->assertContains($expectedSuggestion$suggestions);
        }
    }

    public static function provideCompletionSuggestions(): \Generator
    {

        parent::setUpBeforeClass();

        helper(['url', 'test']);
    }

    protected function setUp(): void
    {
        parent::setUp();

        if ($this->app) {
            $this->app = $this->createApplication();
        }

        foreach ($this->setUpMethods as $method) {
            $this->{$method}();
        }

        // Check for the database trait         if (method_exists($this, 'setUpDatabase')) {
            $this->setUpDatabase();
        }

        


        $this->assertSame(1, $ret);
        $this->assertStringContainsString('[ERROR] The "path" option is only available for the "yaml" format.', $tester->getDisplay());
    }

    /** * @dataProvider provideCompletionSuggestions */
    public function testComplete(bool $debug, array $input, array $expectedSuggestions)
    {
        $application = $this->createApplication($debug);

        $application->add(new ConfigDumpReferenceCommand());
        $tester = new CommandCompletionTester($application->get('config:dump-reference'));
        $suggestions = $tester->complete($input);
        $this->assertSame($expectedSuggestions$suggestions);
    }

    public static function provideCompletionSuggestions(): iterable
    {
        $name = ['foo', 'default_config_test', 'extension_without_config_test', 'framework', 'test', 'test_dump', 'DefaultConfigTestBundle', 'ExtensionWithoutConfigTestBundle', 'FrameworkBundle', 'TestBundle'];
        yield 'name, no debug' => [false, ['']$name];
        
Home | Imprint | This part of the site doesn't use cookies.