2017-06-08 3 views
0

installieren Ich versuche, diesem Handbuch https://www.sitepoint.com/using-selenium-with-phpunit/ zu folgen, damit ich Chrome mit PHP automatisieren kann. Ich habe bereits diese Arbeit in Python habe, aber ich bin einfach so viel besser vertraut mit PHP, dass ich dachte, es einfacher sein würde (vielleicht bin ich falsch ...)Ich kann phpunit und phpunit-selen nicht mit Composer

Wie auch immer, wenn ich laufe

composer require --dev phpunit/phpunit 
composer require --dev phpunit/phpunit-selenium 

Ich habe eine ganze Tonne von Output von Komponisten darüber, wie sie beide von verschiedenen Dingen abhängen, die nicht gleichzeitig möglich sind (ich denke, ich könnte auch hier falsch liegen). Meine Ausgabe:

Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - phpunit/phpunit-selenium 3.0.3 requires phpunit/phpunit ~5.0 -> satisfiable by phpunit/phpunit[5.0.0, 5.0.1, 5.0.10, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.x-dev, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.1.x-dev, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.2.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.x-dev, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.4.x-dev, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.5.x-dev, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.6.x-dev, 5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9, 5.7.x-dev] but these conflict with your requirements or minimum-stability. 
    - phpunit/phpunit-selenium 3.0.2 requires phpunit/phpunit ~5.0 -> satisfiable by phpunit/phpunit[5.0.0, 5.0.1, 5.0.10, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.x-dev, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.1.x-dev, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.2.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.x-dev, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.4.x-dev, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.5.x-dev, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.6.x-dev, 5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9, 5.7.x-dev] but these conflict with your requirements or minimum-stability. 
    - phpunit/phpunit-selenium 3.0.1 requires phpunit/phpunit ~5.0 -> satisfiable by phpunit/phpunit[5.0.0, 5.0.1, 5.0.10, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.x-dev, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.1.x-dev, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.2.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.x-dev, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.4.x-dev, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.5.x-dev, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.6.x-dev, 5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9, 5.7.x-dev] but these conflict with your requirements or minimum-stability. 
    - phpunit/phpunit-selenium 3.0.0 requires phpunit/phpunit ~5 -> satisfiable by phpunit/phpunit[5.0.0, 5.0.1, 5.0.10, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.x-dev, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.1.x-dev, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.2.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.x-dev, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.4.x-dev, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.5.x-dev, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.6.x-dev, 5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9, 5.7.x-dev] but these conflict with your requirements or minimum-stability. 
    - Installation request for phpunit/phpunit-selenium ^3.0 -> satisfiable by phpunit/phpunit-selenium[3.0.0, 3.0.1, 3.0.2, 3.0.3]. 


Installation failed, reverting ./composer.json to its original content. 

Und das ist mein composer.json Inhalt

{ 
    "require": { 
     "giggsey/libphonenumber-for-php": "~7.0", 
     "firephp/firephp-core": "0.4.0", 
     "aws/aws-sdk-php": "^3.3", 
     "jdorn/sql-formatter": "^1.2", 
       "piwik/device-detector": "3.5.0", 
       "doctrine/cache": "1.6.0", 
     "php-console/php-console": "~3.0", 
     "gabrielbull/ups-api": "^0.7.3", 
     "google/apiclient": "^2.0", 
     "jeremeamia/superclosure": "^2.3", 
     "commerceguys/addressing": "^0.8.4", 
     "arcreative/php-address-format": "^0.0.2", 
     "commerceguys/intl": "^0.7.4", 
     "ramsey/uuid": "^3.6", 
     "neitanod/forceutf8": "^2.0", 
     "facebook/webdriver": "^1.4", 
     "phpunit/phpunit": "^6.2" 
    } 
} 

Antwort

1
composer require --dev phpunit/phpunit 

Dies wird die neueste PHPUnit installieren, die derzeit in der Version 6.x ist

composer require --dev phpunit/phpunit-selenium 

Dies wird dann versuchen, die Selen-Erweiterung zu installieren, die installiert werden können, weil es PHPUnit 5.x erfordert, wie Sie die Ausgabe, die Sie als „Problem 1“ erhalten Lesen sehen.

Lösung: Explizit erfordern PHPUnit 5, dann benötigen phpunit-Selen.

Als Randnotiz: Sie gaben das falsche composer.json, es kann nicht mit dem Befehl, den Sie erwähnten, erstellt werden. Es sollte PHPUnit unter "require-dev" aufgelistet haben.

+0

Es sieht so aus, als hätte ich die '--dev' Flag bei der ersten Installation weggelassen, deshalb war es nicht an der richtigen Stelle. Ich musste nachsehen, wie ich eine bestimmte Version benötige. Der Befehl, den ich ausführte (nach dem Entfernen von 'phpunit'), war' php composer.phar require --dev phpunit/phpunit "^ 5" 'und alles funktioniert! –

Verwandte Themen