代码接收失败,并显示消息“名称为“ config”的选项已存在。”

时间:2018-09-13 07:46:08

标签: symfony codeception

在Ubuntu上的php Web项目中运行Codeception 2.4.5,其中通过composer安装了Codeception

====重定向到供应商/代码接收中Composer安装的版本====

我收到错误

An option named "config" already exists.

虽然没有找到错误的原因和原因,但我的临时解决方案是清空/ vendor / codeception目录并运行

composer install

这解决了错误。但是现在我对测试进行了一些更改,然后重新出现。

可能是什么原因?

$: which codecept
   /usr/local/bin/codecept

codeception.yml的内容

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
extensions:
    enabled:
        - Codeception\Extension\RunFailed
modules:
    config:
        Db:
            dsn: ''
            user: ''
            password: ''
            dump: tests/_data/dump.sql

测试内容/acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser
        - \Helper\Acceptance
    config:
        PhpBrowser:
            url: 'http://localhost/suite/www/'

调试输出(等于代码接受运行,bin /代码接受运行或供应商/代码接受/代码接受/代码接受运行)

w@machine:/var/www/_wbs/wbs_suite[master]$ ./vendor/codeception/codeception/codecept run -vvv

In InputDefinition.php line 232:

  [Symfony\Component\Console\Exception\LogicException]  
  An option named "config" already exists.              


Exception trace:
 Symfony\Component\Console\Input\InputDefinition->addOption() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Input/InputDefinition.php:222
 Symfony\Component\Console\Input\InputDefinition->addOptions() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Command/Command.php:306
 Symfony\Component\Console\Command\Command->mergeApplicationDefinition() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Command/Command.php:206
 Symfony\Component\Console\Command\Command->run() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Application.php:946
 Symfony\Component\Console\Application->doRunCommand() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /var/www/_wbs/wbs_suite/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/_wbs/wbs_suite/vendor/codeception/codeception/src/Codeception/Application.php:108
 Codeception\Application->run() at /var/www/_wbs/wbs_suite/vendor/codeception/codeception/codecept:42

在Symfony / Console / Command / Command.php-> mergeApplicationDefinition()中调试输出

mergeApplicationDefinitionArray
(
    [help] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => help
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => h
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Display this help message
        )

    [quiet] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => quiet
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => q
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Do not output any message
        )

    [verbose] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => verbose
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => v|vv|vvv
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
        )

    [version] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => version
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => V
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Display this application version
        )

    [ansi] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => ansi
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => 
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Force ANSI output
        )

    [no-ansi] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => no-ansi
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => 
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Disable ANSI output
        )

    [no-interaction] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => no-interaction
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => n
            [mode:Symfony\Component\Console\Input\InputOption:private] => 1
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Do not ask any interactive question
        )

    [config] => Symfony\Component\Console\Input\InputOption Object
        (
            [name:Symfony\Component\Console\Input\InputOption:private] => config
            [shortcut:Symfony\Component\Console\Input\InputOption:private] => c
            [mode:Symfony\Component\Console\Input\InputOption:private] => 4
            [default:Symfony\Component\Console\Input\InputOption:private] => 
            [description:Symfony\Component\Console\Input\InputOption:private] => Use custom path for config
        )

)

In InputDefinition.php line 232:

  [Symfony\Component\Console\Exception\LogicException]  
  An option named "config" already exists.              

在代码接收源中有几个命令(> 10),其中在命令中添加了选项'config':

        new InputOption('config', 'c', InputOption::VALUE_OPTIONAL, 'Use custom path for config')

不知道,该在哪里重置以及如何避免出现双重选择...

0 个答案:

没有答案