【问题标题】:Behat+Mink+Selenium installationBehat+Mink+Selenium 安装
【发布时间】:2017-05-09 21:34:39
【问题描述】:

尝试安装 Behat+Mink+Selenium 时出现以下错误。有什么解决办法?

php composer.phar 安装

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
    - symfony/framework-standard-edition 2.4.x-dev requires behat/behat 2.4.*@stable -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "minimum-stability": "dev",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0",
        "behat/behat": "2.4.*@stable",
        "behat/mink": "1.4.*@stable",
        "behat/mink-extension": "*",
        "behat/mink-goutte-driver": "*",
        "behat/mink-selenium2-driver": "*",
        "behat/symfony2-extension": "*",
        "behat/mink-browserkit-driver":  "*",
        "behat/mink-sahi-driver": "*",
        "phpunit/phpunit": "3.7.*"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin/"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

我正在关注这两个博客来安装它:

【问题讨论】:

    标签: symfony selenium behat mink


    【解决方案1】:

    IMO,您注册的包裹过多。例如,behat 是 symfony2 扩展的依赖项。所以,只需要要求 symfony2-extension 和 behat 将是必需的 :) 当您明确要求所有内容时,问题是您需要检查每个包约束是否可以在 packagist 上协同工作(这可能会变得很痛苦)......

    对于 Symfony 2.4 项目,我会使用以下包:

    "require-dev": {
        "behat/symfony2-extension": "~1.1",
        "behat/mink-extension": "~1.3",
        "behat/mink-selenium2-driver": "~1.1",
        "behat/mink-goutte-driver": "~1.0",
    }
    

    【讨论】:

    • 如何知道使用什么版本号?
    【解决方案2】:

    我建议运行 composer require,并在安装之前执行 composer update 以便所有依赖项都处于更新版本。所以下面的依赖对我的 symfony2.8 项目很有用:

    composer update
    composer require behat/behat
    composer require behat/symfony2-extension
    composer require behat/mink
    composer require behat/mink-browserkit-driver
    composer require behat/mink-extension
    composer require behat/mink-goutte-driver
    composer require behat/mink-selenium2-driver
    composer require emuse/behat-html-formatter
    composer require coduo/php-matcher
    

    【讨论】:

      猜你喜欢
      • 2017-10-08
      • 2017-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-06
      相关资源
      最近更新 更多