Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
648fa72
Allow Drush::process to escape the command parameters.
greg-1-anderson Nov 3, 2018
bfd3600
Reorganize tests
greg-1-anderson Oct 26, 2018
26a4d72
Code style, and phpunit4 scenario.
greg-1-anderson Oct 26, 2018
c16a71f
Temporarily rename unish dir
greg-1-anderson Oct 29, 2018
f3de45a
Restore correct name for unish directory with correct case
greg-1-anderson Oct 29, 2018
b6bd186
Move unit test helper classes to Unish\Utils
greg-1-anderson Oct 29, 2018
6cbf31c
Move internal-copy to src/internal-forks
greg-1-anderson Oct 29, 2018
4c61416
Remove unnecessary things from travis config
greg-1-anderson Oct 29, 2018
c312b60
Code style
greg-1-anderson Oct 29, 2018
b6d40f1
Put sandbox back in its correct location
greg-1-anderson Oct 29, 2018
c46de0f
Rename preg_match to pregMatch to placiate the code style parser
greg-1-anderson Oct 29, 2018
6294e84
Update phpunit4 scenario
greg-1-anderson Oct 29, 2018
42dbe4d
Correct case for unish autoloader path
greg-1-anderson Oct 29, 2018
d602f45
Update scenarios too
greg-1-anderson Oct 29, 2018
ea8aff5
Relocate UnitBatchOperations.php to its new location
greg-1-anderson Oct 29, 2018
53c562a
Factor out OutputUtilsTrait
greg-1-anderson Oct 30, 2018
1590eaf
Add stderr markers to updatedb test expected values
greg-1-anderson Oct 30, 2018
f8d44c3
Remove files that should not have been committed.
greg-1-anderson Nov 1, 2018
ddd6b52
Code style
greg-1-anderson Nov 1, 2018
43a5b94
Remove integration tests for now, as they are still WIP.
greg-1-anderson Nov 1, 2018
1c1b174
Revert "Allow Drush::process to escape the command parameters."
greg-1-anderson Nov 3, 2018
200819e
Remove .yml files from sut that should not have been committed
greg-1-anderson Nov 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ sudo: false
matrix:
include:
- php: 7.2
env: 'SCENARIO=isolation DEPENDENCIES=highest'
env: 'DEPENDENCIES=highest'
- php: 7.2
env: 'SCENARIO=isolation'
- php: 7.0.11
env: 'SCENARIO=isolation'
- php: 5.6
env: 'SCENARIO=isolation-phpunit4 DEPENDENCIES=lowest'
- php: 5.6
env: 'SCENARIO=isolation-phpunit4 DEPENDENCIES=lowest'
env: 'SCENARIO=phpunit4 DEPENDENCIES=lowest'

env:
global:
Expand Down Expand Up @@ -62,5 +58,3 @@ after_success:
- git config --global user.email $GITHUB_USER_EMAIL
- git config --global user.name "Drush Documentation Bot"
- cd $TRAVIS_BUILD_DIR && build/scripts/publish-api-docs.sh
# Background: https://github.com/drush-ops/drush/pull/1426
#- ${PWD}/tests/testChildren.sh
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@
"autoload": {
"psr-4": {
"Drush\\": "src/",
"Drush\\Internal\\": "internal-copy/",
"Unish\\": "tests/"
"Drush\\Internal\\": "src/internal-forks"
}
},
"autoload-dev": {
"psr-4": {
"Drush\\": "isolation/src/"
"Unish\\": "tests/unish"
},
"files": ["tests/load.environment.php"]
},
Expand Down Expand Up @@ -109,11 +108,10 @@
"scenario": "scenarios/install",
"sut": "./drush --uri=dev",
"sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=${UNISH_DB_URL:-mysql://root:password@mariadb}/unish_dev -v",
"unit": "phpunit --colors=always",
"functional": "phpunit --colors=always --configuration tests",
"unit": "phpunit --colors=always --configuration tests/unit",
"functional": "phpunit --colors=always --configuration tests/functional",
"post-update-cmd": [
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|vlucas/phpdotenv\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation-phpunit4 --base isolation --autoload-dir isolation --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
"create-scenario phpunit4 --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
]
},
"extra": {
Expand Down
2 changes: 0 additions & 2 deletions isolation/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions isolation/src/FunctionUtils.php

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation-phpunit4/isolation

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation/.gitignore

This file was deleted.

112 changes: 0 additions & 112 deletions scenarios/isolation/composer.json

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation/internal-copy

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation/isolation

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation/src

This file was deleted.

1 change: 0 additions & 1 deletion scenarios/isolation/tests

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,51 @@
"require": {
"php": ">=5.6.0",
"ext-dom": "*",
"chi-teck/drupal-code-generator": "^1.27.0",
"composer/semver": "^1.4",
"consolidation/annotated-command": "^2.9.1",
"consolidation/config": "^1.1.0",
"consolidation/site-alias": "^1.1.6|^2",
"consolidation/filter-via-dot-access-data": "^0.4",
"consolidation/output-formatters": "^3.3.1",
"consolidation/robo": "^1.1.5",
"consolidation/site-alias": "^1.1.6",
"consolidation/site-process": "^0.1.13",
"grasmash/yaml-expander": "^1.1.1",
"league/container": "~2",
"psr/log": "~1.0",
"psy/psysh": "~0.6",
"symfony/config": "^3.4",
"symfony/console": "^3.4",
"symfony/event-dispatcher": "^3.4",
"symfony/finder": "^3.4",
"symfony/process": "^3.4",
"symfony/var-dumper": "^3.4 || ^4.0",
"symfony/yaml": "^3.4",
"webflo/drupal-finder": "^1.1",
"webmozart/path-util": "^2.1.0"
},
"require-dev": {
"composer/installers": "^1.2",
"cweagans/composer-patches": "~1.0",
"drupal/alinks": "1.0.0",
"drupal/devel": "^1.0@RC",
"drupal/empty_theme": "1.0",
"g1a/composer-test-scenarios": "^2.2.0",
"lox/xhprof": "dev-master",
"phpunit/phpunit": "^4.8.36",
"vlucas/phpdotenv": "^2.4"
"squizlabs/php_codesniffer": "^2.7",
"vlucas/phpdotenv": "^2.4",
"webflo/drupal-core-strict": "8.6.x-dev"
},
"autoload": {
"psr-4": {
"Drush\\": "src/",
"Drush\\Internal\\": "internal-copy/",
"Unish\\": "tests/"
"Drush\\Internal\\": "src/internal-forks"
}
},
"autoload-dev": {
"psr-4": {
"Drush\\": "isolation/src/"
"Unish\\": "tests/unish"
},
"files": ["tests/load.environment.php"]
},
Expand Down Expand Up @@ -87,11 +109,10 @@
"scenario": "scenarios/install",
"sut": "./drush --uri=dev",
"sut:si": "./drush site:install testing --uri=dev --sites-subdir=dev --db-url=${UNISH_DB_URL:-mysql://root:password@mariadb}/unish_dev -v",
"unit": "phpunit --colors=always",
"functional": "phpunit --colors=always --configuration tests",
"unit": "phpunit --colors=always --configuration tests/unit",
"functional": "phpunit --colors=always --configuration tests/functional",
"post-update-cmd": [
"create-scenario isolation --autoload-dir isolation --autoload-dir internal-copy --keep '\\(psr/log\\|consolidation/config\\|site-alias\\|var-dumper\\|symfony/finder\\|drupal-finder\\|path-util\\|vlucas/phpdotenv\\|xhprof\\)' 'phpunit/phpunit:^5.5.4'",
"create-scenario isolation-phpunit4 --base isolation --autoload-dir isolation --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
"create-scenario phpunit4 --autoload-dir internal-copy 'phpunit/phpunit:^4.8.36'"
]
},
"extra": {
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/Runtime/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ protected function doRun($argv)
$this->preflight->aliasManager()
);

// Our termination handlers depend on classes we set up via DependencyInjection,
// so we do not want to enable it any earlier than this.
// TODO: Inject a termination handler into this class, so that we don't
// need to add these e.g. when testing.
$this->setTerminationHandlers();

// Now that the DI container has been set up, the Application object will
// have a reference to the bootstrap manager et. al., so we may use it
// as needed. Tell the application to coordinate between the Bootstrap
// manager and the alias manager to select a more specific URI, if
// one was not explicitly provided earlier in the preflight.
$application->refineUriSelection($this->preflight->environment()->cwd());

// Our termination handlers depend on classes we set up via DependencyInjection,
// so we do not want to enable it any earlier than this.
// TODO: Inject a termination handler into this class, so that we don't
// need to add these e.g. when testing.
$this->setTerminationHandlers();

// Add global options and copy their values into Config.
$application->configureGlobalOptions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ public static function dump($value, $flags = 0)
case Escaper::requiresDoubleQuoting($value):
return Escaper::escapeWithDoubleQuotes($value);
case Escaper::requiresSingleQuoting($value):
case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value):
case Parser::preg_match(self::getHexRegex(), $value):
case Parser::preg_match(self::getTimestampRegex(), $value):
case Parser::pregMatch('{^[0-9]+[_0-9]*$}', $value):
case Parser::pregMatch(self::getHexRegex(), $value):
case Parser::pregMatch(self::getTimestampRegex(), $value):
return Escaper::escapeWithSingleQuotes($value);
default:
return $value;
Expand Down Expand Up @@ -319,10 +319,10 @@ public static function parseScalar($scalar, $flags = 0, $delimiters = null, &$i
$i += strlen($output);

// remove comments
if (Parser::preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) {
if (Parser::pregMatch('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) {
$output = substr($output, 0, $match[0][1]);
}
} elseif (Parser::preg_match('/^(.'.($legacyOmittedKeySupport ? '+' : '*').'?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
} elseif (Parser::pregMatch('/^(.'.($legacyOmittedKeySupport ? '+' : '*').'?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
$output = $match[1];
$i += strlen($output);
} else {
Expand Down Expand Up @@ -358,7 +358,7 @@ public static function parseScalar($scalar, $flags = 0, $delimiters = null, &$i
*/
private static function parseQuotedScalar($scalar, &$i)
{
if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
if (!Parser::pregMatch('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
throw new ParseException(sprintf('Malformed inline YAML string: %s.', substr($scalar, $i)));
}

Expand Down Expand Up @@ -681,7 +681,7 @@ private static function evaluateScalar($scalar, $flags, $references = array())
// no break
case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || is_numeric($scalar[0]):
switch (true) {
case Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar):
case Parser::pregMatch('{^[+-]?[0-9][0-9_]*$}', $scalar):
$scalar = str_replace('_', '', (string) $scalar);
// omitting the break / return as integers are handled in the next case
// no break
Expand All @@ -696,7 +696,7 @@ private static function evaluateScalar($scalar, $flags, $references = array())

return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw);
case is_numeric($scalar):
case Parser::preg_match(self::getHexRegex(), $scalar):
case Parser::pregMatch(self::getHexRegex(), $scalar):
$scalar = str_replace('_', '', $scalar);

return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar;
Expand All @@ -705,14 +705,14 @@ private static function evaluateScalar($scalar, $flags, $references = array())
return -log(0);
case '-.inf' === $scalarLower:
return log(0);
case Parser::preg_match('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar):
case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
case Parser::pregMatch('/^(-|\+)?[0-9][0-9,]*(\.[0-9_]+)?$/', $scalar):
case Parser::pregMatch('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
if (false !== strpos($scalar, ',')) {
@trigger_error(sprintf('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0 on line %d.', self::$parsedLineNumber + 1), E_USER_DEPRECATED);
}

return (float) str_replace(array(',', '_'), '', $scalar);
case Parser::preg_match(self::getTimestampRegex(), $scalar):
case Parser::pregMatch(self::getTimestampRegex(), $scalar):
if (Yaml::PARSE_DATETIME & $flags) {
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
return new \DateTime($scalar, new \DateTimeZone('UTC'));
Expand Down Expand Up @@ -784,7 +784,7 @@ public static function evaluateBinaryScalar($scalar)
throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', strlen($parsedBinaryData)));
}

if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) {
if (!Parser::pregMatch('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) {
throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData));
}

Expand Down
Loading