Drupal Testing: Drupal Install: 01 - PHP setup

 

 

get cmder

T:\cmder

 

get curl

put in T:\cmder\bin

 

pull php 7.1.6

 

CMDER set alias php

alias php=T:\tools\php7.1.16x86\php.exe

 

 

git clone

git clone --branch 8.5.x https://git.drupal.org/project/drupal.git
cd drupal

 

Get Composer to cmder/tools

  •  
;curl https://getcomposer.org/installer > composer-setup.php

 

Set CMDER php Alias

alias php=T:\tools\php7.1.6x86\php.exe

 

Create composer.phar

php composer-setup.php

 

copy composer.phar to /drupal

  •  

 

Composer install

  •  
php composer.phar install

Error message due to 'modules not found'

T:\cmder
λ php --version
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\php\ext\php_o
penssl.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_openss
l.dll' - The specified module could not be found.
in Unknown on line 0
PHP 7.1.16 (cli) (built: Mar 28 2018 21:27:36) ( ZTS MSVC14 (Visual C++ 201
5) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

 

 

PHP.ini: set extension dir

  •  
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
 ;extension_dir = "./"
; On windows:
extension_dir = "ext"

 

 

 

PHP.ini: enable extensions

  •  
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_openssl.dll

 

Error message for these extensions

  •  
λ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-gd * is missing from your system. Ins
tall or enable PHP's gd extension.
  Problem 2
    - Installation request for easyrdf/easyrdf 0.9.1 -> satisfiable by easy
rdf/easyrdf[0.9.1].
    - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested PHP ex
tension mbstring is missing from your system.
  Problem 3
    - Installation request for drupal/coder 8.2.12 -> satisfiable by drupal
/coder[8.2.12].
    - drupal/coder 8.2.12 requires ext-mbstring * -> the requested PHP exte
nsion mbstring is missing from your system.
  Problem 4
    - Installation request for instaclick/php-webdriver 1.4.5 -> satisfiabl
e by instaclick/php-webdriver[1.4.5].
    - instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested P
HP extension curl is missing from your system.
  Problem 5
    - instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested P
HP extension curl is missing from your system.
    - behat/mink-selenium2-driver dev-master requires instaclick/php-webdri
ver ~1.1 -> satisfiable by instaclick/php-webdriver[1.4.5].
    - Installation request for behat/mink-selenium2-driver dev-master -> sa
tisfiable by behat/mink-selenium2-driver[dev-master].

  To enable extensions, verify that they are enabled in your .ini files:
    - T:\tools\php7.1.16x86\php.ini
  You can also run `php --ini` inside terminal to see which files are used
by PHP in CLI mode.

 

Try Again

  •  
λ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for easyrdf/easyrdf 0.9.1 -> satisfiable by easyrdf/easyrdf[0.9.1].
    - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for drupal/coder 8.2.12 -> satisfiable by drupal/coder[8.2.12].
    - drupal/coder 8.2.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 3
    - Installation request for instaclick/php-webdriver 1.4.5 -> satisfiable by instaclick/php-webdriver[1.4.5].
    - instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
  Problem 4
    - instaclick/php-webdriver 1.4.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - behat/mink-selenium2-driver dev-master requires instaclick/php-webdriver ~1.1 -> satisfiable by instaclick/php-webdriver[1.4.5].
    - Installation request for behat/mink-selenium2-driver dev-master -> satisfiable by behat/mink-selenium2-driver[dev-master].

  To enable extensions, verify that they are enabled in your .ini files:
    - T:\tools\php7.1.16x86\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

 

Successful Composer install

  •  
T:\git\drupal85x\drupal (8.5.x -> origin)
λ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 78 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.5.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing wikimedia/composer-merge-plugin (v1.4.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/polyfill-ctype (v1.8.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing paragonie/random_compat (v2.0.11): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/polyfill-php70 (v1.8.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/polyfill-mbstring (v1.8.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/http-foundation (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/event-dispatcher (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing psr/log (1.0.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/debug (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/http-kernel (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing asm89/stack-cors (1.2.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing composer/semver (1.4.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/lexer (v1.0.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/inflector (v1.1.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/collections (v1.3.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/cache (v1.6.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/annotations (v1.2.7): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/common (v2.6.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing easyrdf/easyrdf (0.9.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing egulias/email-validator (1.2.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing psr/http-message (1.0.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing masterminds/html5 (2.3.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing stack/builder (v1.0.5): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/routing (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony-cmf/routing (1.4.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/class-loader (v3.4.14): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/console (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing psr/container (1.0.0): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/dependency-injection (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/polyfill-iconv (v1.8.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/process (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/psr-http-message-bridge (v1.0.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/serializer (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/translation (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/validator (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing zendframework/zend-diactoros (1.4.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing zendframework/zend-stdlib (3.0.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing zendframework/zend-escaper (2.5.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing zendframework/zend-feed (2.7.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/css-selector (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing behat/mink (dev-master 9ea1ceb): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/dom-crawler (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/browser-kit (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing guzzlehttp/guzzle (6.3.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing fabpot/goutte (v3.2.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing behat/mink-browserkit-driver (v1.3.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing behat/mink-goutte-driver (v1.2.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing instaclick/php-webdriver (1.4.5): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing behat/mink-selenium2-driver (dev-master 93474c6): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/yaml (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing squizlabs/php_codesniffer (2.8.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/coder (8.2.12): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing ircmaxell/password-compat (v1.0.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing twig/twig (v1.35.3): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jcalderonzumba/gastonjs (v1.0.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing jcalderonzumba/mink-phantomjs-driver (v0.3.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing mikey179/vfsstream (v1.6.5): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpdocumentor/reflection-docblock (2.0.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/php-token-stream (1.4.11): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/version (1.0.6): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/global-state (1.1.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/recursion-context (1.0.5): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/exporter (1.2.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/environment (1.3.8): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/diff (1.4.1): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing sebastian/comparator (1.2.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing doctrine/instantiator (1.0.5): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/phpunit-mock-objects (2.3.8): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/php-timer (1.0.9): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/php-code-coverage (2.2.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpspec/prophecy (v1.7.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing phpunit/phpunit (4.8.36): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing symfony/phpunit-bridge (v3.4.14): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/finder
symfony/http-kernel suggests installing symfony/var-dumper
easyrdf/easyrdf suggests installing ml/json-ld (~1.0)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
symfony/console suggests installing symfony/lock
symfony/dependency-injection suggests installing symfony/config
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/finder (For using double-star glob patterns or when GLOB_BRACE portability is required)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
symfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/serializer suggests installing symfony/config (For using the XML mapping loader.)
symfony/serializer suggests installing symfony/property-access (For using the ObjectNormalizer.)
symfony/serializer suggests installing symfony/property-info (To deserialize relations.)
symfony/translation suggests installing symfony/config
symfony/validator suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/validator suggests installing symfony/config
symfony/validator suggests installing symfony/expression-language (For using the Expression validator)
symfony/validator suggests installing symfony/intl
symfony/validator suggests installing symfony/property-access (For accessing properties within comparison constraints)
zendframework/zend-feed suggests installing zendframework/zend-cache (Zend\Cache component, for optionally caching feeds between requests)
zendframework/zend-feed suggests installing zendframework/zend-db (Zend\Db component, for use with PubSubHubbub)
zendframework/zend-feed suggests installing zendframework/zend-http (Zend\Http for PubSubHubbub, and optionally for use with Zend\Feed\Reader)
zendframework/zend-feed suggests installing zendframework/zend-servicemanager (Zend\ServiceManager component, for easily extending ExtensionManager implementations)
zendframework/zend-feed suggests installing zendframework/zend-validator (Zend\Validator component, for validating email addresses used in Atom feeds and entries ehen using the Writer subcomponent)
behat/mink suggests installing behat/mink-zombie-driver (fast and JS-enabled headless driver for any app (requires node.js))
phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

 

Project Build Errors Occuring in behat/mink

most seem to be from 'use' statements, particularly with symphony

 

Eclipse IDE PHP Version Config

  1. Right-click on the project folder and choose Properties
  2. In the properties dialog, in PHP > Validation
    1. Enable project specific settings
    2. As PHP Version choose
      • 7.0 (uniform variable syntax, scalar type hint,...) or
      • 7.1 (void return types, class constant visibility,...)

You also might configure installed PHPs: Window > Properties: PHP > Installed PHPs

 

 

PHPUnit, Behat, & Drupal  Versions

 

phpunit/php-code-coverage            2.2.4
phpunit/php-file-iterator            1.4.2
phpunit/php-text-template            1.2.1
phpunit/php-timer                    1.0.9
phpunit/php-token-stream             1.4.11
phpunit/phpunit                      4.8.36
phpunit/phpunit-mock-objects         2.3.8

 

Behat 3.3.1 Info

 

 

Added  behat/behat to require-dev

 

    "require-dev":{
        "behat/behat": "^3.5"
    },

 

Composer Install

T:\git\drupal85x\drupal (8.5.x -> origin)
λ php composer.phar install
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.
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

 

Composer Update

 

CSS Selector error

image

 


The CssSelector Component

4.1 version
The CssSelector component converts CSS selectors to XPath expressions.

Installation

 composer require symfony/css-selector

Alternatively, you can clone the https://github.com/symfony/css-selector repository.

 

NOTE

If you install this component outside of a Symfony application, you must require the vendor/autoload.php file in your code to enable the class autoloading mechanism provided by Composer. Read this article for more details.


composer.json now has require...

symfony/css-selector ^4.1

 

Clear the composer.lock & composer install

T:\git\drupal85x\drupal (8.5.x -> origin)
λ php composer.phar install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update

  [Composer\DependencyResolver\SolverProblemsException]
  Problem 1
      - The requested package symfony/css-selector ^4.1 exists as symfony/css-selector[v3.4.17] but these are rej
  ected by your constraint.

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

 

 


 

 

 

 

 

 

 

 

 

 

 

Tags