diff --git a/test/lib/drivers/webdriver/phpwebdriver/autoload.php b/test/lib/drivers/webdriver/phpwebdriver/autoload.php deleted file mode 100644 index f0c36beb2d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/autoload.php +++ /dev/null @@ -1,12 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var ?string */ - private $vendorDir; - - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ - private $missingClasses = array(); - - /** @var ?string */ - private $apcuPrefix; - - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - /** - * @return string[] - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array[] - * @psalm-return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return string[] Array of classname => path - * @psalm-return array - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/InstalledVersions.php b/test/lib/drivers/webdriver/phpwebdriver/composer/InstalledVersions.php deleted file mode 100644 index c6b54af7ba..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/InstalledVersions.php +++ /dev/null @@ -1,352 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/LICENSE b/test/lib/drivers/webdriver/phpwebdriver/composer/LICENSE deleted file mode 100644 index f27399a042..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_classmap.php b/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_classmap.php deleted file mode 100644 index 5490b88d87..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_classmap.php +++ /dev/null @@ -1,15 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_files.php b/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_files.php deleted file mode 100644 index a6ccb3706b..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_files.php +++ /dev/null @@ -1,12 +0,0 @@ - $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '2a3c2110e8e0295330dc3d11a4cbc4cb' => $vendorDir . '/php-webdriver/webdriver/lib/Exception/TimeoutException.php', -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_namespaces.php b/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3ad6..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Facebook\\WebDriver\\' => array($vendorDir . '/php-webdriver/webdriver/lib'), -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_real.php b/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_real.php deleted file mode 100644 index ae4da9e9f2..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_real.php +++ /dev/null @@ -1,57 +0,0 @@ -register(true); - - $includeFiles = \Composer\Autoload\ComposerStaticInita9d739e5f031abd9c929e6b2f18db2f1::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirea9d739e5f031abd9c929e6b2f18db2f1($fileIdentifier, $file); - } - - return $loader; - } -} - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequirea9d739e5f031abd9c929e6b2f18db2f1($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_static.php b/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_static.php deleted file mode 100644 index 7ebda19ea8..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/autoload_static.php +++ /dev/null @@ -1,65 +0,0 @@ - __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '2a3c2110e8e0295330dc3d11a4cbc4cb' => __DIR__ . '/..' . '/php-webdriver/webdriver/lib/Exception/TimeoutException.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Component\\Process\\' => 26, - ), - 'F' => - array ( - 'Facebook\\WebDriver\\' => 19, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Component\\Process\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/process', - ), - 'Facebook\\WebDriver\\' => - array ( - 0 => __DIR__ . '/..' . '/php-webdriver/webdriver/lib', - ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInita9d739e5f031abd9c929e6b2f18db2f1::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInita9d739e5f031abd9c929e6b2f18db2f1::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInita9d739e5f031abd9c929e6b2f18db2f1::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/installed.json b/test/lib/drivers/webdriver/phpwebdriver/composer/installed.json deleted file mode 100644 index 945c70f23a..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/installed.json +++ /dev/null @@ -1,311 +0,0 @@ -{ - "packages": [ - { - "name": "php-webdriver/webdriver", - "version": "1.12.1", - "version_normalized": "1.12.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/b27ddf458d273c7d4602106fcaf978aa0b7fe15a", - "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-zip": "*", - "php": "^5.6 || ~7.0 || ^8.0", - "symfony/polyfill-mbstring": "^1.12", - "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0" - }, - "replace": { - "facebook/webdriver": "*" - }, - "require-dev": { - "ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", - "php-coveralls/php-coveralls": "^2.4", - "php-mock/php-mock-phpunit": "^1.1 || ^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", - "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0" - }, - "suggest": { - "ext-SimpleXML": "For Firefox profile creation" - }, - "time": "2022-05-03T12:16:34+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/Exception/TimeoutException.php" - ], - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", - "homepage": "https://github.com/php-webdriver/php-webdriver", - "keywords": [ - "Chromedriver", - "geckodriver", - "php", - "selenium", - "webdriver" - ], - "support": { - "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.1" - }, - "install-path": "../php-webdriver/webdriver" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", - "version_normalized": "1.26.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2022-05-24T11:49:31+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.26.0", - "version_normalized": "1.26.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-05-10T07:21:04+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/process", - "version": "v5.4.8", - "version_normalized": "5.4.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", - "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2022-04-08T05:07:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.4.8" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/process" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/installed.php b/test/lib/drivers/webdriver/phpwebdriver/composer/installed.php deleted file mode 100644 index 1f22468a0e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/installed.php +++ /dev/null @@ -1,65 +0,0 @@ - array( - 'name' => '__root__', - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - '__root__' => array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'facebook/webdriver' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '*', - ), - ), - 'php-webdriver/webdriver' => array( - 'pretty_version' => '1.12.1', - 'version' => '1.12.1.0', - 'reference' => 'b27ddf458d273c7d4602106fcaf978aa0b7fe15a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-webdriver/webdriver', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v5.4.8', - 'version' => '5.4.8.0', - 'reference' => '597f3fff8e3e91836bb0bd38f5718b56ddbde2f3', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/composer/platform_check.php b/test/lib/drivers/webdriver/phpwebdriver/composer/platform_check.php deleted file mode 100644 index a8b98d5ceb..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70205)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/.php-cs-fixer.dist.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/.php-cs-fixer.dist.php deleted file mode 100644 index 051fb6579f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/.php-cs-fixer.dist.php +++ /dev/null @@ -1,117 +0,0 @@ -in([__DIR__ . '/lib', __DIR__ . '/tests']); - -return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => ['statements' => ['return', 'try']], - 'braces' => ['allow_single_line_anonymous_class_with_empty_body' => true, 'allow_single_line_closure' => true], - 'cast_spaces' => true, - 'class_attributes_separation' => ['elements' => ['method' => 'one']], - 'clean_namespace' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => true, - 'fopen_flag_order' => true, - 'fopen_flags' => true, - 'full_opening_tag' => true, - 'function_typehint_space' => true, - 'implode_call' => true, - 'is_null' => true, - 'lambda_not_used_import' => true, - 'linebreak_after_opening_tag' => true, - 'lowercase_cast' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'mb_str_functions' => true, - 'native_function_casing' => true, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, - 'no_alias_functions' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'normalize_index_brace' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'break', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'switch', - 'throw', - 'use', - 'use_trait', - ], - ], - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_useless_sprintf' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => false, - 'php_unit_expectation' => ['target' => '5.6'], - 'php_unit_method_casing' => ['case' => 'camel_case'], - 'php_unit_mock_short_will_return' => true, - 'php_unit_mock' => true, - 'php_unit_namespaced' => ['target' => '5.7'], - 'php_unit_no_expectation_annotation' => true, - 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - // 'phpdoc_no_empty_return' => true, // disabled to allow forward compatibility with PHP 8.1 - 'phpdoc_no_package' => true, - 'phpdoc_order_by_value' => ['annotations' => ['covers', 'group', 'throws']], - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_annotation_correct_order' => true, - 'psr_autoloading' => true, - 'self_accessor' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'single_space_after_construct' => true, - 'single_trait_insert_per_statement' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'strict_param' => true, - 'switch_continue_to_break' => true, - 'ternary_operator_spaces' => true, - 'ternary_to_elvis_operator' => true, - 'trailing_comma_in_multiline' => ['elements' => ['arrays']], - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => ['elements' => ['method', 'property']], - 'whitespace_after_comma_in_array' => true, - 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], - ]) - ->setRiskyAllowed(true) - ->setFinder($finder); diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/composer.json b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/composer.json deleted file mode 100644 index 90f2d0f282..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/composer.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "php-webdriver/webdriver", - "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", - "license": "MIT", - "type": "library", - "keywords": [ - "webdriver", - "selenium", - "php", - "geckodriver", - "chromedriver" - ], - "homepage": "https://github.com/php-webdriver/php-webdriver", - "require": { - "php": "^5.6 || ~7.0 || ^8.0", - "ext-curl": "*", - "ext-json": "*", - "ext-zip": "*", - "symfony/polyfill-mbstring": "^1.12", - "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", - "php-coveralls/php-coveralls": "^2.4", - "php-mock/php-mock-phpunit": "^1.1 || ^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", - "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0" - }, - "replace": { - "facebook/webdriver": "*" - }, - "suggest": { - "ext-SimpleXML": "For Firefox profile creation" - }, - "minimum-stability": "dev", - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - }, - "files": [ - "lib/Exception/TimeoutException.php" - ] - }, - "autoload-dev": { - "psr-4": { - "Facebook\\WebDriver\\": [ - "tests/unit", - "tests/functional" - ] - }, - "classmap": [ - "tests/functional/" - ] - }, - "config": { - "allow-plugins": { - "ergebnis/composer-normalize": true - }, - "sort-packages": true - }, - "scripts": { - "post-install-cmd": [ - "php -r 'if (PHP_VERSION_ID > 70103) { exit(1); }' || composer install --working-dir=tools/php-cs-fixer --no-progress --no-interaction" - ], - "post-update-cmd": [ - "php -r 'if (PHP_VERSION_ID > 70103) { exit(1); }' || composer update --working-dir=tools/php-cs-fixer --no-progress --no-interaction" - ], - "all": [ - "@lint", - "@analyze", - "@test" - ], - "analyze": [ - "vendor/bin/phpstan analyze -c phpstan.neon --ansi", - "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --dry-run -vvv --ansi", - "vendor/bin/phpcs --standard=PSR2 ./lib/ ./tests/" - ], - "fix": [ - "@composer normalize", - "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff -vvv || exit 0", - "vendor/bin/phpcbf --standard=PSR2 ./lib/ ./tests/" - ], - "lint": [ - "vendor/bin/parallel-lint -j 10 ./lib ./tests example.php", - "@composer validate", - "@composer normalize --dry-run" - ], - "preinstall": [ - "@composer update --no-progress --no-interaction", - "@composer require --dev phpstan/phpstan", - "@composer require --dev ergebnis/composer-normalize" - ], - "test": [ - "vendor/bin/phpunit --colors=always" - ] - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/AbstractWebDriverCheckboxOrRadio.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/AbstractWebDriverCheckboxOrRadio.php deleted file mode 100644 index 450bc387e1..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/AbstractWebDriverCheckboxOrRadio.php +++ /dev/null @@ -1,240 +0,0 @@ -getTagName(); - if ($tagName !== 'input') { - throw new UnexpectedTagNameException('input', $tagName); - } - - $this->name = $element->getAttribute('name'); - if ($this->name === null) { - throw new WebDriverException('The input does not have a "name" attribute.'); - } - - $this->element = $element; - } - - public function getOptions() - { - return $this->getRelatedElements(); - } - - public function getAllSelectedOptions() - { - $selectedElement = []; - foreach ($this->getRelatedElements() as $element) { - if ($element->isSelected()) { - $selectedElement[] = $element; - - if (!$this->isMultiple()) { - return $selectedElement; - } - } - } - - return $selectedElement; - } - - public function getFirstSelectedOption() - { - foreach ($this->getRelatedElements() as $element) { - if ($element->isSelected()) { - return $element; - } - } - - throw new NoSuchElementException( - sprintf('No %s are selected', $this->type === 'radio' ? 'radio buttons' : 'checkboxes') - ); - } - - public function selectByIndex($index) - { - $this->byIndex($index); - } - - public function selectByValue($value) - { - $this->byValue($value); - } - - public function selectByVisibleText($text) - { - $this->byVisibleText($text); - } - - public function selectByVisiblePartialText($text) - { - $this->byVisibleText($text, true); - } - - /** - * Selects or deselects a checkbox or a radio button by its value. - * - * @param string $value - * @param bool $select - * @throws NoSuchElementException - */ - protected function byValue($value, $select = true) - { - $matched = false; - foreach ($this->getRelatedElements($value) as $element) { - $select ? $this->selectOption($element) : $this->deselectOption($element); - if (!$this->isMultiple()) { - return; - } - - $matched = true; - } - - if (!$matched) { - throw new NoSuchElementException( - sprintf('Cannot locate %s with value: %s', $this->type, $value) - ); - } - } - - /** - * Selects or deselects a checkbox or a radio button by its index. - * - * @param int $index - * @param bool $select - * @throws NoSuchElementException - */ - protected function byIndex($index, $select = true) - { - $elements = $this->getRelatedElements(); - if (!isset($elements[$index])) { - throw new NoSuchElementException(sprintf('Cannot locate %s with index: %d', $this->type, $index)); - } - - $select ? $this->selectOption($elements[$index]) : $this->deselectOption($elements[$index]); - } - - /** - * Selects or deselects a checkbox or a radio button by its visible text. - * - * @param string $text - * @param bool $partial - * @param bool $select - */ - protected function byVisibleText($text, $partial = false, $select = true) - { - foreach ($this->getRelatedElements() as $element) { - $normalizeFilter = sprintf( - $partial ? 'contains(normalize-space(.), %s)' : 'normalize-space(.) = %s', - XPathEscaper::escapeQuotes($text) - ); - - $xpath = 'ancestor::label'; - $xpathNormalize = sprintf('%s[%s]', $xpath, $normalizeFilter); - - $id = $element->getAttribute('id'); - if ($id !== null) { - $idFilter = sprintf('@for = %s', XPathEscaper::escapeQuotes($id)); - - $xpath .= sprintf(' | //label[%s]', $idFilter); - $xpathNormalize .= sprintf(' | //label[%s and %s]', $idFilter, $normalizeFilter); - } - - try { - $element->findElement(WebDriverBy::xpath($xpathNormalize)); - } catch (NoSuchElementException $e) { - if ($partial) { - continue; - } - - try { - // Since the mechanism of getting the text in xpath is not the same as - // webdriver, use the expensive getText() to check if nothing is matched. - if ($text !== $element->findElement(WebDriverBy::xpath($xpath))->getText()) { - continue; - } - } catch (NoSuchElementException $e) { - continue; - } - } - - $select ? $this->selectOption($element) : $this->deselectOption($element); - if (!$this->isMultiple()) { - return; - } - } - } - - /** - * Gets checkboxes or radio buttons with the same name. - * - * @param string|null $value - * @return WebDriverElement[] - */ - protected function getRelatedElements($value = null) - { - $valueSelector = $value ? sprintf(' and @value = %s', XPathEscaper::escapeQuotes($value)) : ''; - $formId = $this->element->getAttribute('form'); - if ($formId === null) { - $form = $this->element->findElement(WebDriverBy::xpath('ancestor::form')); - - $formId = $form->getAttribute('id'); - if ($formId === '' || $formId === null) { - return $form->findElements(WebDriverBy::xpath( - sprintf('.//input[@name = %s%s]', XPathEscaper::escapeQuotes($this->name), $valueSelector) - )); - } - } - - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form - return $this->element->findElements( - WebDriverBy::xpath(sprintf( - '//form[@id = %1$s]//input[@name = %2$s%3$s' - . ' and ((boolean(@form) = true() and @form = %1$s) or boolean(@form) = false())]' - . ' | //input[@form = %1$s and @name = %2$s%3$s]', - XPathEscaper::escapeQuotes($formId), - XPathEscaper::escapeQuotes($this->name), - $valueSelector - )) - ); - } - - /** - * Selects a checkbox or a radio button. - */ - protected function selectOption(WebDriverElement $element) - { - if (!$element->isSelected()) { - $element->click(); - } - } - - /** - * Deselects a checkbox or a radio button. - */ - protected function deselectOption(WebDriverElement $element) - { - if ($element->isSelected()) { - $element->click(); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDevToolsDriver.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDevToolsDriver.php deleted file mode 100644 index ffbb91a187..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDevToolsDriver.php +++ /dev/null @@ -1,46 +0,0 @@ - 'POST', - 'url' => '/session/:sessionId/goog/cdp/execute', - ]; - - /** - * @var RemoteWebDriver - */ - private $driver; - - public function __construct(RemoteWebDriver $driver) - { - $this->driver = $driver; - } - - /** - * Executes a Chrome DevTools command - * - * @param string $command The DevTools command to execute - * @param array $parameters Optional parameters to the command - * @return array The result of the command - */ - public function execute($command, array $parameters = []) - { - $params = ['cmd' => $command, 'params' => (object) $parameters]; - - return $this->driver->executeCustomCommand( - self::SEND_COMMAND['url'], - self::SEND_COMMAND['method'], - $params - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriver.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriver.php deleted file mode 100644 index 1d840eaed7..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriver.php +++ /dev/null @@ -1,105 +0,0 @@ - [ - 'firstMatch' => [(object) $capabilities->toW3cCompatibleArray()], - ], - 'desiredCapabilities' => (object) $capabilities->toArray(), - ] - ); - - $response = $executor->execute($newSessionCommand); - - /* - * TODO: in next major version we may not need to use this method, because without OSS compatibility the - * driver creation is straightforward. - */ - return static::createFromResponse($response, $executor); - } - - /** - * @todo Remove in next major version. The class is internally no longer used and is kept only to keep BC. - * @deprecated Use start or startUsingDriverService method instead. - * @codeCoverageIgnore - * @internal - */ - public function startSession(DesiredCapabilities $desired_capabilities) - { - $command = WebDriverCommand::newSession( - [ - 'capabilities' => [ - 'firstMatch' => [(object) $desired_capabilities->toW3cCompatibleArray()], - ], - 'desiredCapabilities' => (object) $desired_capabilities->toArray(), - ] - ); - $response = $this->executor->execute($command); - $value = $response->getValue(); - - if (!$this->isW3cCompliant = isset($value['capabilities'])) { - $this->executor->disableW3cCompliance(); - } - - $this->sessionID = $response->getSessionID(); - } - - /** - * @return ChromeDevToolsDriver - */ - public function getDevTools() - { - if ($this->devTools === null) { - $this->devTools = new ChromeDevToolsDriver($this); - } - - return $this->devTools; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriverService.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriverService.php deleted file mode 100644 index a6d3eb8346..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Chrome/ChromeDriverService.php +++ /dev/null @@ -1,37 +0,0 @@ -toArray(); - } - - /** - * Sets the path of the Chrome executable. The path should be either absolute - * or relative to the location running ChromeDriver server. - * - * @param string $path - * @return ChromeOptions - */ - public function setBinary($path) - { - $this->binary = $path; - - return $this; - } - - /** - * @param array $arguments - * @return ChromeOptions - */ - public function addArguments(array $arguments) - { - $this->arguments = array_merge($this->arguments, $arguments); - - return $this; - } - - /** - * Add a Chrome extension to install on browser startup. Each path should be - * a packed Chrome extension. - * - * @param array $paths - * @return ChromeOptions - */ - public function addExtensions(array $paths) - { - foreach ($paths as $path) { - $this->addExtension($path); - } - - return $this; - } - - /** - * @param array $encoded_extensions An array of base64 encoded of the extensions. - * @return ChromeOptions - */ - public function addEncodedExtensions(array $encoded_extensions) - { - foreach ($encoded_extensions as $encoded_extension) { - $this->addEncodedExtension($encoded_extension); - } - - return $this; - } - - /** - * Sets an experimental option which has not exposed officially. - * - * @param string $name - * @param mixed $value - * @return ChromeOptions - */ - public function setExperimentalOption($name, $value) - { - $this->experimentalOptions[$name] = $value; - - return $this; - } - - /** - * @return DesiredCapabilities The DesiredCapabilities for Chrome with this options. - */ - public function toCapabilities() - { - $capabilities = DesiredCapabilities::chrome(); - $capabilities->setCapability(self::CAPABILITY, $this); - - return $capabilities; - } - - /** - * @return \ArrayObject|array - */ - public function toArray() - { - // The selenium server expects a 'dictionary' instead of a 'list' when - // reading the chrome option. However, an empty array in PHP will be - // converted to a 'list' instead of a 'dictionary'. To fix it, we work - // with `ArrayObject` - $options = new \ArrayObject($this->experimentalOptions); - - if (!empty($this->binary)) { - $options['binary'] = $this->binary; - } - - if (!empty($this->arguments)) { - $options['args'] = $this->arguments; - } - - if (!empty($this->extensions)) { - $options['extensions'] = $this->extensions; - } - - return $options; - } - - /** - * Add a Chrome extension to install on browser startup. Each path should be a - * packed Chrome extension. - * - * @param string $path - * @return ChromeOptions - */ - private function addExtension($path) - { - $this->addEncodedExtension(base64_encode(file_get_contents($path))); - - return $this; - } - - /** - * @param string $encoded_extension Base64 encoded of the extension. - * @return ChromeOptions - */ - private function addEncodedExtension($encoded_extension) - { - $this->extensions[] = $encoded_extension; - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Cookie.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Cookie.php deleted file mode 100644 index 77b04687c8..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Cookie.php +++ /dev/null @@ -1,278 +0,0 @@ -validateCookieName($name); - $this->validateCookieValue($value); - - $this->cookie['name'] = $name; - $this->cookie['value'] = $value; - } - - /** - * @param array $cookieArray The cookie fields; must contain name and value. - * @return Cookie - */ - public static function createFromArray(array $cookieArray) - { - if (!isset($cookieArray['name'])) { - throw new InvalidArgumentException('Cookie name should be set'); - } - if (!isset($cookieArray['value'])) { - throw new InvalidArgumentException('Cookie value should be set'); - } - $cookie = new self($cookieArray['name'], $cookieArray['value']); - - if (isset($cookieArray['path'])) { - $cookie->setPath($cookieArray['path']); - } - if (isset($cookieArray['domain'])) { - $cookie->setDomain($cookieArray['domain']); - } - if (isset($cookieArray['expiry'])) { - $cookie->setExpiry($cookieArray['expiry']); - } - if (isset($cookieArray['secure'])) { - $cookie->setSecure($cookieArray['secure']); - } - if (isset($cookieArray['httpOnly'])) { - $cookie->setHttpOnly($cookieArray['httpOnly']); - } - if (isset($cookieArray['sameSite'])) { - $cookie->setSameSite($cookieArray['sameSite']); - } - - return $cookie; - } - - /** - * @return string - */ - public function getName() - { - return $this->offsetGet('name'); - } - - /** - * @return string - */ - public function getValue() - { - return $this->offsetGet('value'); - } - - /** - * The path the cookie is visible to. Defaults to "/" if omitted. - * - * @param string $path - */ - public function setPath($path) - { - $this->offsetSet('path', $path); - } - - /** - * @return string|null - */ - public function getPath() - { - return $this->offsetGet('path'); - } - - /** - * The domain the cookie is visible to. Defaults to the current browsing context's document's URL domain if omitted. - * - * @param string $domain - */ - public function setDomain($domain) - { - if (mb_strpos($domain, ':') !== false) { - throw new InvalidArgumentException(sprintf('Cookie domain "%s" should not contain a port', $domain)); - } - - $this->offsetSet('domain', $domain); - } - - /** - * @return string|null - */ - public function getDomain() - { - return $this->offsetGet('domain'); - } - - /** - * The cookie's expiration date, specified in seconds since Unix Epoch. - * - * @param int $expiry - */ - public function setExpiry($expiry) - { - $this->offsetSet('expiry', (int) $expiry); - } - - /** - * @return int|null - */ - public function getExpiry() - { - return $this->offsetGet('expiry'); - } - - /** - * Whether this cookie requires a secure connection (https). Defaults to false if omitted. - * - * @param bool $secure - */ - public function setSecure($secure) - { - $this->offsetSet('secure', $secure); - } - - /** - * @return bool|null - */ - public function isSecure() - { - return $this->offsetGet('secure'); - } - - /** - * Whether the cookie is an HTTP only cookie. Defaults to false if omitted. - * - * @param bool $httpOnly - */ - public function setHttpOnly($httpOnly) - { - $this->offsetSet('httpOnly', $httpOnly); - } - - /** - * @return bool|null - */ - public function isHttpOnly() - { - return $this->offsetGet('httpOnly'); - } - - /** - * The cookie's same-site value. - * - * @param string $sameSite - */ - public function setSameSite($sameSite) - { - $this->offsetSet('sameSite', $sameSite); - } - - /** - * @return string|null - */ - public function getSameSite() - { - return $this->offsetGet('sameSite'); - } - - /** - * @return array - */ - public function toArray() - { - $cookie = $this->cookie; - if (!isset($cookie['secure'])) { - // Passing a boolean value for the "secure" flag is mandatory when using geckodriver - $cookie['secure'] = false; - } - - return $cookie; - } - - /** - * @param mixed $offset - * @return bool - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->cookie[$offset]); - } - - /** - * @param mixed $offset - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->cookie[$offset] : null; - } - - /** - * @param mixed $offset - * @param mixed $value - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if ($value === null) { - unset($this->cookie[$offset]); - } else { - $this->cookie[$offset] = $value; - } - } - - /** - * @param mixed $offset - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->cookie[$offset]); - } - - /** - * @param string $name - */ - protected function validateCookieName($name) - { - if ($name === null || $name === '') { - throw new InvalidArgumentException('Cookie name should be non-empty'); - } - - if (mb_strpos($name, ';') !== false) { - throw new InvalidArgumentException('Cookie name should not contain a ";"'); - } - } - - /** - * @param string $value - */ - protected function validateCookieValue($value) - { - if ($value === null) { - throw new InvalidArgumentException('Cookie value is required when setting a cookie'); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/DriverServerDiedException.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/DriverServerDiedException.php deleted file mode 100644 index c3eff3b9e1..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/DriverServerDiedException.php +++ /dev/null @@ -1,15 +0,0 @@ -getMessage(), $this->getCode(), $previous); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/ElementClickInterceptedException.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/ElementClickInterceptedException.php deleted file mode 100644 index 349e963ff5..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/ElementClickInterceptedException.php +++ /dev/null @@ -1,11 +0,0 @@ -results = $results; - } - - /** - * @return mixed - */ - public function getResults() - { - return $this->results; - } - - /** - * Throw WebDriverExceptions based on WebDriver status code. - * - * @param int|string $status_code - * @param string $message - * @param mixed $results - * - * @throws ElementClickInterceptedException - * @throws ElementNotInteractableException - * @throws ElementNotSelectableException - * @throws ElementNotVisibleException - * @throws ExpectedException - * @throws IMEEngineActivationFailedException - * @throws IMENotAvailableException - * @throws IndexOutOfBoundsException - * @throws InsecureCertificateException - * @throws InvalidArgumentException - * @throws InvalidCookieDomainException - * @throws InvalidCoordinatesException - * @throws InvalidElementStateException - * @throws InvalidSelectorException - * @throws InvalidSessionIdException - * @throws JavascriptErrorException - * @throws MoveTargetOutOfBoundsException - * @throws NoAlertOpenException - * @throws NoCollectionException - * @throws NoScriptResultException - * @throws NoStringException - * @throws NoStringLengthException - * @throws NoStringWrapperException - * @throws NoSuchAlertException - * @throws NoSuchCollectionException - * @throws NoSuchCookieException - * @throws NoSuchDocumentException - * @throws NoSuchDriverException - * @throws NoSuchElementException - * @throws NoSuchFrameException - * @throws NoSuchWindowException - * @throws NullPointerException - * @throws ScriptTimeoutException - * @throws SessionNotCreatedException - * @throws StaleElementReferenceException - * @throws TimeoutException - * @throws UnableToCaptureScreenException - * @throws UnableToSetCookieException - * @throws UnexpectedAlertOpenException - * @throws UnexpectedJavascriptException - * @throws UnknownCommandException - * @throws UnknownErrorException - * @throws UnknownMethodException - * @throws UnknownServerException - * @throws UnrecognizedExceptionException - * @throws UnsupportedOperationException - * @throws XPathLookupException - */ - public static function throwException($status_code, $message, $results) - { - if (is_string($status_code)) { - // @see https://w3c.github.io/webdriver/#errors - switch ($status_code) { - case 'element click intercepted': - throw new ElementClickInterceptedException($message, $results); - case 'element not interactable': - throw new ElementNotInteractableException($message, $results); - case 'insecure certificate': - throw new InsecureCertificateException($message, $results); - case 'invalid argument': - throw new InvalidArgumentException($message, $results); - case 'invalid cookie domain': - throw new InvalidCookieDomainException($message, $results); - case 'invalid element state': - throw new InvalidElementStateException($message, $results); - case 'invalid selector': - throw new InvalidSelectorException($message, $results); - case 'invalid session id': - throw new InvalidSessionIdException($message, $results); - case 'javascript error': - throw new JavascriptErrorException($message, $results); - case 'move target out of bounds': - throw new MoveTargetOutOfBoundsException($message, $results); - case 'no such alert': - throw new NoSuchAlertException($message, $results); - case 'no such cookie': - throw new NoSuchCookieException($message, $results); - case 'no such element': - throw new NoSuchElementException($message, $results); - case 'no such frame': - throw new NoSuchFrameException($message, $results); - case 'no such window': - throw new NoSuchWindowException($message, $results); - case 'script timeout': - throw new ScriptTimeoutException($message, $results); - case 'session not created': - throw new SessionNotCreatedException($message, $results); - case 'stale element reference': - throw new StaleElementReferenceException($message, $results); - case 'timeout': - throw new TimeoutException($message, $results); - case 'unable to set cookie': - throw new UnableToSetCookieException($message, $results); - case 'unable to capture screen': - throw new UnableToCaptureScreenException($message, $results); - case 'unexpected alert open': - throw new UnexpectedAlertOpenException($message, $results); - case 'unknown command': - throw new UnknownCommandException($message, $results); - case 'unknown error': - throw new UnknownErrorException($message, $results); - case 'unknown method': - throw new UnknownMethodException($message, $results); - case 'unsupported operation': - throw new UnsupportedOperationException($message, $results); - default: - throw new UnrecognizedExceptionException($message, $results); - } - } - - switch ($status_code) { - case 1: - throw new IndexOutOfBoundsException($message, $results); - case 2: - throw new NoCollectionException($message, $results); - case 3: - throw new NoStringException($message, $results); - case 4: - throw new NoStringLengthException($message, $results); - case 5: - throw new NoStringWrapperException($message, $results); - case 6: - throw new NoSuchDriverException($message, $results); - case 7: - throw new NoSuchElementException($message, $results); - case 8: - throw new NoSuchFrameException($message, $results); - case 9: - throw new UnknownCommandException($message, $results); - case 10: - throw new StaleElementReferenceException($message, $results); - case 11: - throw new ElementNotVisibleException($message, $results); - case 12: - throw new InvalidElementStateException($message, $results); - case 13: - throw new UnknownServerException($message, $results); - case 14: - throw new ExpectedException($message, $results); - case 15: - throw new ElementNotSelectableException($message, $results); - case 16: - throw new NoSuchDocumentException($message, $results); - case 17: - throw new UnexpectedJavascriptException($message, $results); - case 18: - throw new NoScriptResultException($message, $results); - case 19: - throw new XPathLookupException($message, $results); - case 20: - throw new NoSuchCollectionException($message, $results); - case 21: - throw new TimeoutException($message, $results); - case 22: - throw new NullPointerException($message, $results); - case 23: - throw new NoSuchWindowException($message, $results); - case 24: - throw new InvalidCookieDomainException($message, $results); - case 25: - throw new UnableToSetCookieException($message, $results); - case 26: - throw new UnexpectedAlertOpenException($message, $results); - case 27: - throw new NoAlertOpenException($message, $results); - case 28: - throw new ScriptTimeoutException($message, $results); - case 29: - throw new InvalidCoordinatesException($message, $results); - case 30: - throw new IMENotAvailableException($message, $results); - case 31: - throw new IMEEngineActivationFailedException($message, $results); - case 32: - throw new InvalidSelectorException($message, $results); - case 33: - throw new SessionNotCreatedException($message, $results); - case 34: - throw new MoveTargetOutOfBoundsException($message, $results); - default: - throw new UnrecognizedExceptionException($message, $results); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/XPathLookupException.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/XPathLookupException.php deleted file mode 100644 index 86513db581..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Exception/XPathLookupException.php +++ /dev/null @@ -1,10 +0,0 @@ - [ - 'firstMatch' => [(object) $capabilities->toW3cCompatibleArray()], - ], - ] - ); - - $response = $executor->execute($newSessionCommand); - - $returnedCapabilities = DesiredCapabilities::createFromW3cCapabilities($response->getValue()['capabilities']); - $sessionId = $response->getSessionID(); - - return new static($executor, $sessionId, $returnedCapabilities, true); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxDriverService.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxDriverService.php deleted file mode 100644 index 525c5b5bc2..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxDriverService.php +++ /dev/null @@ -1,34 +0,0 @@ -setPreference(FirefoxPreferences::READER_PARSE_ON_LOAD_ENABLED, false); - // disable JSON viewer and let JSON be rendered as raw data - $this->setPreference(FirefoxPreferences::DEVTOOLS_JSONVIEW, false); - } - - /** - * Directly set firefoxOptions. - * Use `addArguments` to add command line arguments and `setPreference` to set Firefox about:config entry. - * - * @param string $name - * @param mixed $value - * @return self - */ - public function setOption($name, $value) - { - if ($name === self::OPTION_PREFS) { - throw new \InvalidArgumentException('Use setPreference() method to set Firefox preferences'); - } - if ($name === self::OPTION_ARGS) { - throw new \InvalidArgumentException('Use addArguments() method to add Firefox arguments'); - } - - $this->options[$name] = $value; - - return $this; - } - - /** - * Command line arguments to pass to the Firefox binary. - * These must include the leading dash (-) where required, e.g. ['-headless']. - * - * @see https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions#args - * @param string[] $arguments - * @return self - */ - public function addArguments(array $arguments) - { - $this->arguments = array_merge($this->arguments, $arguments); - - return $this; - } - - /** - * Set Firefox preference (about:config entry). - * - * @see http://kb.mozillazine.org/About:config_entries - * @see https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions#prefs - * @param string $name - * @param string|bool|int $value - * @return self - */ - public function setPreference($name, $value) - { - $this->preferences[$name] = $value; - - return $this; - } - - /** - * @return array - */ - public function toArray() - { - $array = $this->options; - if (!empty($this->arguments)) { - $array[self::OPTION_ARGS] = $this->arguments; - } - if (!empty($this->preferences)) { - $array[self::OPTION_PREFS] = $this->preferences; - } - - return $array; - } - - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return new \ArrayObject($this->toArray()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxPreferences.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxPreferences.php deleted file mode 100644 index 159a9c8065..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Firefox/FirefoxPreferences.php +++ /dev/null @@ -1,25 +0,0 @@ -extensions[] = $extension; - - return $this; - } - - /** - * @param string $extension_datas The path to the folder containing the datas to add to the extension - * @return FirefoxProfile - */ - public function addExtensionDatas($extension_datas) - { - if (!is_dir($extension_datas)) { - return null; - } - - $this->extensions_datas[basename($extension_datas)] = $extension_datas; - - return $this; - } - - /** - * @param string $rdf_file The path to the rdf file - * @return FirefoxProfile - */ - public function setRdfFile($rdf_file) - { - if (!is_file($rdf_file)) { - return null; - } - - $this->rdf_file = $rdf_file; - - return $this; - } - - /** - * @param string $key - * @param string|bool|int $value - * @throws WebDriverException - * @return FirefoxProfile - */ - public function setPreference($key, $value) - { - if (is_string($value)) { - $value = sprintf('"%s"', $value); - } else { - if (is_int($value)) { - $value = sprintf('%d', $value); - } else { - if (is_bool($value)) { - $value = $value ? 'true' : 'false'; - } else { - throw new WebDriverException( - 'The value of the preference should be either a string, int or bool.' - ); - } - } - } - $this->preferences[$key] = $value; - - return $this; - } - - /** - * @param mixed $key - * @return mixed - */ - public function getPreference($key) - { - if (array_key_exists($key, $this->preferences)) { - return $this->preferences[$key]; - } - - return null; - } - - /** - * @return string - */ - public function encode() - { - $temp_dir = $this->createTempDirectory('WebDriverFirefoxProfile'); - - if (isset($this->rdf_file)) { - copy($this->rdf_file, $temp_dir . DIRECTORY_SEPARATOR . 'mimeTypes.rdf'); - } - - foreach ($this->extensions as $extension) { - $this->installExtension($extension, $temp_dir); - } - - foreach ($this->extensions_datas as $dirname => $extension_datas) { - mkdir($temp_dir . DIRECTORY_SEPARATOR . $dirname); - $iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($extension_datas, RecursiveDirectoryIterator::SKIP_DOTS), - RecursiveIteratorIterator::SELF_FIRST - ); - foreach ($iterator as $item) { - $target_dir = $temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR - . $iterator->getSubPathName(); - - if ($item->isDir()) { - mkdir($target_dir); - } else { - copy($item, $target_dir); - } - } - } - - $content = ''; - foreach ($this->preferences as $key => $value) { - $content .= sprintf("user_pref(\"%s\", %s);\n", $key, $value); - } - file_put_contents($temp_dir . '/user.js', $content); - - // Intentionally do not use `tempnam()`, as it creates empty file which zip extension may not handle. - $temp_zip = sys_get_temp_dir() . '/' . uniqid('WebDriverFirefoxProfileZip', false); - - $zip = new ZipArchive(); - $zip->open($temp_zip, ZipArchive::CREATE); - - $dir = new RecursiveDirectoryIterator($temp_dir); - $files = new RecursiveIteratorIterator($dir); - - $dir_prefix = preg_replace( - '#\\\\#', - '\\\\\\\\', - $temp_dir . DIRECTORY_SEPARATOR - ); - - foreach ($files as $name => $object) { - if (is_dir($name)) { - continue; - } - - $path = preg_replace("#^{$dir_prefix}#", '', $name); - $zip->addFile($name, $path); - } - $zip->close(); - - $profile = base64_encode(file_get_contents($temp_zip)); - - // clean up - $this->deleteDirectory($temp_dir); - unlink($temp_zip); - - return $profile; - } - - /** - * @param string $extension The path to the extension. - * @param string $profile_dir The path to the profile directory. - * @return string The path to the directory of this extension. - */ - private function installExtension($extension, $profile_dir) - { - $temp_dir = $this->createTempDirectory('WebDriverFirefoxProfileExtension'); - $this->extractTo($extension, $temp_dir); - - // This is a hacky way to parse the id since there is no offical RDF parser library. - // Find the correct namespace for the id element. - $install_rdf_path = $temp_dir . '/install.rdf'; - $xml = simplexml_load_file($install_rdf_path); - $ns = $xml->getDocNamespaces(); - $prefix = ''; - if (!empty($ns)) { - foreach ($ns as $key => $value) { - if (mb_strpos($value, '//www.mozilla.org/2004/em-rdf') > 0) { - if ($key != '') { - $prefix = $key . ':'; // Separate the namespace from the name. - } - break; - } - } - } - // Get the extension id from the install manifest. - $matches = []; - preg_match('#<' . $prefix . 'id>([^<]+)#', $xml->asXML(), $matches); - if (isset($matches[1])) { - $ext_dir = $profile_dir . '/extensions/' . $matches[1]; - mkdir($ext_dir, 0777, true); - $this->extractTo($extension, $ext_dir); - } else { - $this->deleteDirectory($temp_dir); - - throw new WebDriverException('Cannot get the extension id from the install manifest.'); - } - - $this->deleteDirectory($temp_dir); - - return $ext_dir; - } - - /** - * @param string $prefix Prefix of the temp directory. - * - * @throws WebDriverException - * @return string The path to the temp directory created. - */ - private function createTempDirectory($prefix = '') - { - $temp_dir = tempnam(sys_get_temp_dir(), $prefix); - if (file_exists($temp_dir)) { - unlink($temp_dir); - mkdir($temp_dir); - if (!is_dir($temp_dir)) { - throw new WebDriverException('Cannot create firefox profile.'); - } - } - - return $temp_dir; - } - - /** - * @param string $directory The path to the directory. - */ - private function deleteDirectory($directory) - { - $dir = new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS); - $paths = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST); - - foreach ($paths as $path) { - if ($path->isDir() && !$path->isLink()) { - rmdir($path->getPathname()); - } else { - unlink($path->getPathname()); - } - } - - rmdir($directory); - } - - /** - * @param string $xpi The path to the .xpi extension. - * @param string $target_dir The path to the unzip directory. - * - * @throws \Exception - * @return FirefoxProfile - */ - private function extractTo($xpi, $target_dir) - { - $zip = new ZipArchive(); - if (file_exists($xpi)) { - if ($zip->open($xpi)) { - $zip->extractTo($target_dir); - $zip->close(); - } else { - throw new \Exception("Failed to open the firefox extension. '$xpi'"); - } - } else { - throw new \Exception("Firefox extension doesn't exist. '$xpi'"); - } - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php deleted file mode 100644 index 91cad24afb..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php +++ /dev/null @@ -1,16 +0,0 @@ -mouse->mouseUp($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php deleted file mode 100644 index e21b883367..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php +++ /dev/null @@ -1,13 +0,0 @@ -mouse->click($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php deleted file mode 100644 index 5f5042c0b8..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php +++ /dev/null @@ -1,16 +0,0 @@ -mouse->mouseDown($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php deleted file mode 100644 index 493978bba1..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php +++ /dev/null @@ -1,16 +0,0 @@ -mouse->contextClick($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php deleted file mode 100644 index 387bdbea69..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php +++ /dev/null @@ -1,78 +0,0 @@ -onScreen = $on_screen; - $this->inViewPort = $in_view_port; - $this->onPage = $on_page; - $this->auxiliary = $auxiliary; - } - - /** - * @throws UnsupportedOperationException - * @return WebDriverPoint - */ - public function onScreen() - { - throw new UnsupportedOperationException( - 'onScreen is planned but not yet supported by Selenium' - ); - } - - /** - * @return WebDriverPoint - */ - public function inViewPort() - { - return call_user_func($this->inViewPort); - } - - /** - * @return WebDriverPoint - */ - public function onPage() - { - return call_user_func($this->onPage); - } - - /** - * @return string The attached object id. - */ - public function getAuxiliary() - { - return $this->auxiliary; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php deleted file mode 100644 index 386c496390..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php +++ /dev/null @@ -1,13 +0,0 @@ -mouse->doubleClick($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php deleted file mode 100644 index 415ebe7f1d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php +++ /dev/null @@ -1,12 +0,0 @@ -focusOnElement(); - $this->keyboard->pressKey($this->key); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php deleted file mode 100644 index 0cdb3a84f1..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php +++ /dev/null @@ -1,12 +0,0 @@ -focusOnElement(); - $this->keyboard->releaseKey($this->key); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php deleted file mode 100644 index 69f4aa1799..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php +++ /dev/null @@ -1,48 +0,0 @@ -keyboard = $keyboard; - $this->mouse = $mouse; - $this->locationProvider = $location_provider; - } - - protected function focusOnElement() - { - if ($this->locationProvider) { - $this->mouse->click($this->locationProvider->getCoordinates()); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php deleted file mode 100644 index 5cb0cfd10c..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php +++ /dev/null @@ -1,48 +0,0 @@ -mouse = $mouse; - $this->locationProvider = $location_provider; - } - - /** - * @return null|WebDriverCoordinates - */ - protected function getActionLocation() - { - if ($this->locationProvider !== null) { - return $this->locationProvider->getCoordinates(); - } - - return null; - } - - protected function moveToLocation() - { - $this->mouse->mouseMove($this->locationProvider); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php deleted file mode 100644 index 1969f01bad..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php +++ /dev/null @@ -1,13 +0,0 @@ -mouse->mouseMove($this->getActionLocation()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php deleted file mode 100644 index 98fd824d75..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php +++ /dev/null @@ -1,45 +0,0 @@ -xOffset = $x_offset; - $this->yOffset = $y_offset; - } - - public function perform() - { - $this->mouse->mouseMove( - $this->getActionLocation(), - $this->xOffset, - $this->yOffset - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php deleted file mode 100644 index 4e65cc27c6..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php +++ /dev/null @@ -1,38 +0,0 @@ -keys = $keys; - } - - public function perform() - { - $this->focusOnElement(); - $this->keyboard->sendKeys($this->keys); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php deleted file mode 100644 index 9b1a014d59..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php +++ /dev/null @@ -1,53 +0,0 @@ -key = $key; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDoubleTapAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDoubleTapAction.php deleted file mode 100644 index 25a1761b3e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDoubleTapAction.php +++ /dev/null @@ -1,13 +0,0 @@ -touchScreen->doubleTap($this->locationProvider); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDownAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDownAction.php deleted file mode 100644 index 2e0f1e5d1e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDownAction.php +++ /dev/null @@ -1,34 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen); - } - - public function perform() - { - $this->touchScreen->down($this->x, $this->y); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickAction.php deleted file mode 100644 index 5430852ac4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickAction.php +++ /dev/null @@ -1,34 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen); - } - - public function perform() - { - $this->touchScreen->flick($this->x, $this->y); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickFromElementAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickFromElementAction.php deleted file mode 100644 index 799febe10e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickFromElementAction.php +++ /dev/null @@ -1,52 +0,0 @@ -x = $x; - $this->y = $y; - $this->speed = $speed; - parent::__construct($touch_screen, $element); - } - - public function perform() - { - $this->touchScreen->flickFromElement( - $this->locationProvider, - $this->x, - $this->y, - $this->speed - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverLongPressAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverLongPressAction.php deleted file mode 100644 index 7c1a165c6c..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverLongPressAction.php +++ /dev/null @@ -1,13 +0,0 @@ -touchScreen->longPress($this->locationProvider); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverMoveAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverMoveAction.php deleted file mode 100644 index 8cdf5eb991..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverMoveAction.php +++ /dev/null @@ -1,28 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen); - } - - public function perform() - { - $this->touchScreen->move($this->x, $this->y); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollAction.php deleted file mode 100644 index 0fd40c5b4c..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollAction.php +++ /dev/null @@ -1,28 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen); - } - - public function perform() - { - $this->touchScreen->scroll($this->x, $this->y); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollFromElementAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollFromElementAction.php deleted file mode 100644 index ba68bc62c3..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollFromElementAction.php +++ /dev/null @@ -1,38 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen, $element); - } - - public function perform() - { - $this->touchScreen->scrollFromElement( - $this->locationProvider, - $this->x, - $this->y - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTapAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTapAction.php deleted file mode 100644 index 63527e8103..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTapAction.php +++ /dev/null @@ -1,13 +0,0 @@ -touchScreen->tap($this->locationProvider); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchAction.php deleted file mode 100644 index 3919170a94..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchAction.php +++ /dev/null @@ -1,42 +0,0 @@ -touchScreen = $touch_screen; - $this->locationProvider = $location_provider; - } - - /** - * @return null|WebDriverCoordinates - */ - protected function getActionLocation() - { - return $this->locationProvider !== null - ? $this->locationProvider->getCoordinates() : null; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchScreen.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchScreen.php deleted file mode 100644 index 21696fc90c..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchScreen.php +++ /dev/null @@ -1,114 +0,0 @@ -driver = $driver; - $this->keyboard = $driver->getKeyboard(); - $this->mouse = $driver->getMouse(); - $this->action = new WebDriverCompositeAction(); - } - - /** - * A convenience method for performing the actions without calling build(). - */ - public function perform() - { - $this->action->perform(); - } - - /** - * Mouse click. - * If $element is provided, move to the middle of the element first. - * - * @param WebDriverElement $element - * @return WebDriverActions - */ - public function click(WebDriverElement $element = null) - { - $this->action->addAction( - new WebDriverClickAction($this->mouse, $element) - ); - - return $this; - } - - /** - * Mouse click and hold. - * If $element is provided, move to the middle of the element first. - * - * @param WebDriverElement $element - * @return WebDriverActions - */ - public function clickAndHold(WebDriverElement $element = null) - { - $this->action->addAction( - new WebDriverClickAndHoldAction($this->mouse, $element) - ); - - return $this; - } - - /** - * Context-click (right click). - * If $element is provided, move to the middle of the element first. - * - * @param WebDriverElement $element - * @return WebDriverActions - */ - public function contextClick(WebDriverElement $element = null) - { - $this->action->addAction( - new WebDriverContextClickAction($this->mouse, $element) - ); - - return $this; - } - - /** - * Double click. - * If $element is provided, move to the middle of the element first. - * - * @param WebDriverElement $element - * @return WebDriverActions - */ - public function doubleClick(WebDriverElement $element = null) - { - $this->action->addAction( - new WebDriverDoubleClickAction($this->mouse, $element) - ); - - return $this; - } - - /** - * Drag and drop from $source to $target. - * - * @param WebDriverElement $source - * @param WebDriverElement $target - * @return WebDriverActions - */ - public function dragAndDrop(WebDriverElement $source, WebDriverElement $target) - { - $this->action->addAction( - new WebDriverClickAndHoldAction($this->mouse, $source) - ); - $this->action->addAction( - new WebDriverMouseMoveAction($this->mouse, $target) - ); - $this->action->addAction( - new WebDriverButtonReleaseAction($this->mouse, $target) - ); - - return $this; - } - - /** - * Drag $source and drop by offset ($x_offset, $y_offset). - * - * @param WebDriverElement $source - * @param int $x_offset - * @param int $y_offset - * @return WebDriverActions - */ - public function dragAndDropBy(WebDriverElement $source, $x_offset, $y_offset) - { - $this->action->addAction( - new WebDriverClickAndHoldAction($this->mouse, $source) - ); - $this->action->addAction( - new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset) - ); - $this->action->addAction( - new WebDriverButtonReleaseAction($this->mouse, null) - ); - - return $this; - } - - /** - * Mouse move by offset. - * - * @param int $x_offset - * @param int $y_offset - * @return WebDriverActions - */ - public function moveByOffset($x_offset, $y_offset) - { - $this->action->addAction( - new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset) - ); - - return $this; - } - - /** - * Move to the middle of the given WebDriverElement. - * Extra shift, calculated from the top-left corner of the element, can be set by passing $x_offset and $y_offset - * parameters. - * - * @param WebDriverElement $element - * @param int $x_offset - * @param int $y_offset - * @return WebDriverActions - */ - public function moveToElement(WebDriverElement $element, $x_offset = null, $y_offset = null) - { - $this->action->addAction(new WebDriverMoveToOffsetAction( - $this->mouse, - $element, - $x_offset, - $y_offset - )); - - return $this; - } - - /** - * Release the mouse button. - * If $element is provided, move to the middle of the element first. - * - * @param WebDriverElement $element - * @return WebDriverActions - */ - public function release(WebDriverElement $element = null) - { - $this->action->addAction( - new WebDriverButtonReleaseAction($this->mouse, $element) - ); - - return $this; - } - - /** - * Press a key on keyboard. - * If $element is provided, focus on that element first. - * - * @see WebDriverKeys for special keys like CONTROL, ALT, etc. - * @param WebDriverElement $element - * @param string $key - * @return WebDriverActions - */ - public function keyDown(WebDriverElement $element = null, $key = null) - { - $this->action->addAction( - new WebDriverKeyDownAction($this->keyboard, $this->mouse, $element, $key) - ); - - return $this; - } - - /** - * Release a key on keyboard. - * If $element is provided, focus on that element first. - * - * @see WebDriverKeys for special keys like CONTROL, ALT, etc. - * @param WebDriverElement $element - * @param string $key - * @return WebDriverActions - */ - public function keyUp(WebDriverElement $element = null, $key = null) - { - $this->action->addAction( - new WebDriverKeyUpAction($this->keyboard, $this->mouse, $element, $key) - ); - - return $this; - } - - /** - * Send keys by keyboard. - * If $element is provided, focus on that element first (using single mouse click). - * - * @see WebDriverKeys for special keys like CONTROL, ALT, etc. - * @param WebDriverElement $element - * @param string $keys - * @return WebDriverActions - */ - public function sendKeys(WebDriverElement $element = null, $keys = null) - { - $this->action->addAction( - new WebDriverSendKeysAction( - $this->keyboard, - $this->mouse, - $element, - $keys - ) - ); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverCompositeAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverCompositeAction.php deleted file mode 100644 index 168bf5ff51..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverCompositeAction.php +++ /dev/null @@ -1,49 +0,0 @@ -actions[] = $action; - - return $this; - } - - /** - * Get the number of actions in the sequence. - * - * @return int The number of actions. - */ - public function getNumberOfActions() - { - return count($this->actions); - } - - /** - * Perform the sequence of actions. - */ - public function perform() - { - foreach ($this->actions as $action) { - $action->perform(); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverTouchActions.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverTouchActions.php deleted file mode 100644 index da0e47815a..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Interactions/WebDriverTouchActions.php +++ /dev/null @@ -1,180 +0,0 @@ -touchScreen = $driver->getTouch(); - } - - /** - * @param WebDriverElement $element - * @return WebDriverTouchActions - */ - public function tap(WebDriverElement $element) - { - $this->action->addAction( - new WebDriverTapAction($this->touchScreen, $element) - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function down($x, $y) - { - $this->action->addAction( - new WebDriverDownAction($this->touchScreen, $x, $y) - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function up($x, $y) - { - $this->action->addAction( - new WebDriverUpAction($this->touchScreen, $x, $y) - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function move($x, $y) - { - $this->action->addAction( - new WebDriverMoveAction($this->touchScreen, $x, $y) - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function scroll($x, $y) - { - $this->action->addAction( - new WebDriverScrollAction($this->touchScreen, $x, $y) - ); - - return $this; - } - - /** - * @param WebDriverElement $element - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function scrollFromElement(WebDriverElement $element, $x, $y) - { - $this->action->addAction( - new WebDriverScrollFromElementAction($this->touchScreen, $element, $x, $y) - ); - - return $this; - } - - /** - * @param WebDriverElement $element - * @return WebDriverTouchActions - */ - public function doubleTap(WebDriverElement $element) - { - $this->action->addAction( - new WebDriverDoubleTapAction($this->touchScreen, $element) - ); - - return $this; - } - - /** - * @param WebDriverElement $element - * @return WebDriverTouchActions - */ - public function longPress(WebDriverElement $element) - { - $this->action->addAction( - new WebDriverLongPressAction($this->touchScreen, $element) - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * @return WebDriverTouchActions - */ - public function flick($x, $y) - { - $this->action->addAction( - new WebDriverFlickAction($this->touchScreen, $x, $y) - ); - - return $this; - } - - /** - * @param WebDriverElement $element - * @param int $x - * @param int $y - * @param int $speed - * @return WebDriverTouchActions - */ - public function flickFromElement(WebDriverElement $element, $x, $y, $speed) - { - $this->action->addAction( - new WebDriverFlickFromElementAction( - $this->touchScreen, - $element, - $x, - $y, - $speed - ) - ); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Internal/WebDriverLocatable.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Internal/WebDriverLocatable.php deleted file mode 100644 index 225a10d661..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Internal/WebDriverLocatable.php +++ /dev/null @@ -1,16 +0,0 @@ - microtime(true)) { - if ($this->getHTTPResponseCode($url) === 200) { - return $this; - } - usleep(self::POLL_INTERVAL_MS); - } - - throw new TimeoutException(sprintf( - 'Timed out waiting for %s to become available after %d ms.', - $url, - $timeout_in_ms - )); - } - - public function waitUntilUnavailable($timeout_in_ms, $url) - { - $end = microtime(true) + $timeout_in_ms / 1000; - - while ($end > microtime(true)) { - if ($this->getHTTPResponseCode($url) !== 200) { - return $this; - } - usleep(self::POLL_INTERVAL_MS); - } - - throw new TimeoutException(sprintf( - 'Timed out waiting for %s to become unavailable after %d ms.', - $url, - $timeout_in_ms - )); - } - - private function getHTTPResponseCode($url) - { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - // The PHP doc indicates that CURLOPT_CONNECTTIMEOUT_MS constant is added in cURL 7.16.2 - // available since PHP 5.2.3. - if (!defined('CURLOPT_CONNECTTIMEOUT_MS')) { - define('CURLOPT_CONNECTTIMEOUT_MS', 156); // default value for CURLOPT_CONNECTTIMEOUT_MS - } - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, self::CONNECT_TIMEOUT_MS); - - $code = null; - - try { - curl_exec($ch); - $info = curl_getinfo($ch); - $code = $info['http_code']; - } catch (Exception $e) { - } - curl_close($ch); - - return $code; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/CustomWebDriverCommand.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/CustomWebDriverCommand.php deleted file mode 100644 index 157902199e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/CustomWebDriverCommand.php +++ /dev/null @@ -1,82 +0,0 @@ -setCustomRequestParameters($url, $method); - - parent::__construct($session_id, DriverCommand::CUSTOM_COMMAND, $parameters); - } - - /** - * @throws WebDriverException - * @return string - */ - public function getCustomUrl() - { - if ($this->customUrl === null) { - throw new WebDriverException('URL of custom command is not set'); - } - - return $this->customUrl; - } - - /** - * @throws WebDriverException - * @return string - */ - public function getCustomMethod() - { - if ($this->customMethod === null) { - throw new WebDriverException('Method of custom command is not set'); - } - - return $this->customMethod; - } - - /** - * @param string $custom_url - * @param string $custom_method - * @throws WebDriverException - */ - protected function setCustomRequestParameters($custom_url, $custom_method) - { - $allowedMethods = [static::METHOD_GET, static::METHOD_POST]; - if (!in_array($custom_method, $allowedMethods, true)) { - throw new WebDriverException( - sprintf( - 'Invalid custom method "%s", must be one of [%s]', - $custom_method, - implode(', ', $allowedMethods) - ) - ); - } - $this->customMethod = $custom_method; - - if (mb_strpos($custom_url, '/') !== 0) { - throw new WebDriverException( - sprintf('URL of custom command has to start with / but is "%s"', $custom_url) - ); - } - $this->customUrl = $custom_url; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DesiredCapabilities.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DesiredCapabilities.php deleted file mode 100644 index a7bde312e2..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DesiredCapabilities.php +++ /dev/null @@ -1,440 +0,0 @@ - 'platformName', - WebDriverCapabilityType::VERSION => 'browserVersion', - WebDriverCapabilityType::ACCEPT_SSL_CERTS => 'acceptInsecureCerts', - ChromeOptions::CAPABILITY => ChromeOptions::CAPABILITY_W3C, - ]; - - public function __construct(array $capabilities = []) - { - $this->capabilities = $capabilities; - } - - public static function createFromW3cCapabilities(array $capabilities = []) - { - $w3cToOss = array_flip(self::$ossToW3c); - - foreach ($w3cToOss as $w3cCapability => $ossCapability) { - // Copy W3C capabilities to OSS ones - if (array_key_exists($w3cCapability, $capabilities)) { - $capabilities[$ossCapability] = $capabilities[$w3cCapability]; - } - } - - return new self($capabilities); - } - - /** - * @return string The name of the browser. - */ - public function getBrowserName() - { - return $this->get(WebDriverCapabilityType::BROWSER_NAME, ''); - } - - /** - * @param string $browser_name - * @return DesiredCapabilities - */ - public function setBrowserName($browser_name) - { - $this->set(WebDriverCapabilityType::BROWSER_NAME, $browser_name); - - return $this; - } - - /** - * @return string The version of the browser. - */ - public function getVersion() - { - return $this->get(WebDriverCapabilityType::VERSION, ''); - } - - /** - * @param string $version - * @return DesiredCapabilities - */ - public function setVersion($version) - { - $this->set(WebDriverCapabilityType::VERSION, $version); - - return $this; - } - - /** - * @param string $name - * @return mixed The value of a capability. - */ - public function getCapability($name) - { - return $this->get($name); - } - - /** - * @param string $name - * @param mixed $value - * @return DesiredCapabilities - */ - public function setCapability($name, $value) - { - // When setting 'moz:firefoxOptions' from an array and not from instance of FirefoxOptions, we must merge - // it with default FirefoxOptions to keep previous behavior (where the default preferences were added - // using FirefoxProfile, thus not overwritten by adding 'moz:firefoxOptions') - // TODO: remove in next major version, once FirefoxOptions are only accepted as object instance and not as array - if ($name === FirefoxOptions::CAPABILITY && is_array($value)) { - $defaultOptions = (new FirefoxOptions())->toArray(); - $value = array_merge($defaultOptions, $value); - } - - $this->set($name, $value); - - return $this; - } - - /** - * @return string The name of the platform. - */ - public function getPlatform() - { - return $this->get(WebDriverCapabilityType::PLATFORM, ''); - } - - /** - * @param string $platform - * @return DesiredCapabilities - */ - public function setPlatform($platform) - { - $this->set(WebDriverCapabilityType::PLATFORM, $platform); - - return $this; - } - - /** - * @param string $capability_name - * @return bool Whether the value is not null and not false. - */ - public function is($capability_name) - { - return (bool) $this->get($capability_name); - } - - /** - * @todo Remove in next major release (BC) - * @deprecated All browsers are always JS enabled except HtmlUnit and it's not meaningful to disable JS execution. - * @return bool Whether javascript is enabled. - */ - public function isJavascriptEnabled() - { - return $this->get(WebDriverCapabilityType::JAVASCRIPT_ENABLED, false); - } - - /** - * This is a htmlUnit-only option. - * - * @param bool $enabled - * @throws Exception - * @return DesiredCapabilities - * @see https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities - */ - public function setJavascriptEnabled($enabled) - { - $browser = $this->getBrowserName(); - if ($browser && $browser !== WebDriverBrowserType::HTMLUNIT) { - throw new Exception( - 'isJavascriptEnabled() is a htmlunit-only option. ' . - 'See https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities.' - ); - } - - $this->set(WebDriverCapabilityType::JAVASCRIPT_ENABLED, $enabled); - - return $this; - } - - /** - * @todo Remove side-effects - not change eg. ChromeOptions::CAPABILITY from instance of ChromeOptions to an array - * @return array - */ - public function toArray() - { - if (isset($this->capabilities[ChromeOptions::CAPABILITY]) && - $this->capabilities[ChromeOptions::CAPABILITY] instanceof ChromeOptions - ) { - $this->capabilities[ChromeOptions::CAPABILITY] = - $this->capabilities[ChromeOptions::CAPABILITY]->toArray(); - } - - if (isset($this->capabilities[FirefoxOptions::CAPABILITY]) && - $this->capabilities[FirefoxOptions::CAPABILITY] instanceof FirefoxOptions - ) { - $this->capabilities[FirefoxOptions::CAPABILITY] = - $this->capabilities[FirefoxOptions::CAPABILITY]->toArray(); - } - - if (isset($this->capabilities[FirefoxDriver::PROFILE]) && - $this->capabilities[FirefoxDriver::PROFILE] instanceof FirefoxProfile - ) { - $this->capabilities[FirefoxDriver::PROFILE] = - $this->capabilities[FirefoxDriver::PROFILE]->encode(); - } - - return $this->capabilities; - } - - /** - * @return array - */ - public function toW3cCompatibleArray() - { - $allowedW3cCapabilities = [ - 'browserName', - 'browserVersion', - 'platformName', - 'acceptInsecureCerts', - 'pageLoadStrategy', - 'proxy', - 'setWindowRect', - 'timeouts', - 'strictFileInteractability', - 'unhandledPromptBehavior', - ]; - - $ossCapabilities = $this->toArray(); - $w3cCapabilities = []; - - foreach ($ossCapabilities as $capabilityKey => $capabilityValue) { - // Copy already W3C compatible capabilities - if (in_array($capabilityKey, $allowedW3cCapabilities, true)) { - $w3cCapabilities[$capabilityKey] = $capabilityValue; - } - - // Convert capabilities with changed name - if (array_key_exists($capabilityKey, self::$ossToW3c)) { - if ($capabilityKey === WebDriverCapabilityType::PLATFORM) { - $w3cCapabilities[self::$ossToW3c[$capabilityKey]] = mb_strtolower($capabilityValue); - - // Remove platformName if it is set to "any" - if ($w3cCapabilities[self::$ossToW3c[$capabilityKey]] === 'any') { - unset($w3cCapabilities[self::$ossToW3c[$capabilityKey]]); - } - } else { - $w3cCapabilities[self::$ossToW3c[$capabilityKey]] = $capabilityValue; - } - } - - // Copy vendor extensions - if (mb_strpos($capabilityKey, ':') !== false) { - $w3cCapabilities[$capabilityKey] = $capabilityValue; - } - } - - // Convert ChromeOptions - if (array_key_exists(ChromeOptions::CAPABILITY, $ossCapabilities)) { - if (array_key_exists(ChromeOptions::CAPABILITY_W3C, $ossCapabilities)) { - $w3cCapabilities[ChromeOptions::CAPABILITY_W3C] = new \ArrayObject( - array_merge_recursive( - (array) $ossCapabilities[ChromeOptions::CAPABILITY], - (array) $ossCapabilities[ChromeOptions::CAPABILITY_W3C] - ) - ); - } else { - $w3cCapabilities[ChromeOptions::CAPABILITY_W3C] = $ossCapabilities[ChromeOptions::CAPABILITY]; - } - } - - // Convert Firefox profile - if (array_key_exists(FirefoxDriver::PROFILE, $ossCapabilities)) { - // Convert profile only if not already set in moz:firefoxOptions - if (!array_key_exists(FirefoxOptions::CAPABILITY, $ossCapabilities) - || !array_key_exists('profile', $ossCapabilities[FirefoxOptions::CAPABILITY])) { - $w3cCapabilities[FirefoxOptions::CAPABILITY]['profile'] = $ossCapabilities[FirefoxDriver::PROFILE]; - } - } - - return $w3cCapabilities; - } - - /** - * @return static - */ - public static function android() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::ANDROID, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANDROID, - ]); - } - - /** - * @return static - */ - public static function chrome() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::CHROME, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - } - - /** - * @return static - */ - public static function firefox() - { - $caps = new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::FIREFOX, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - - $caps->setCapability(FirefoxOptions::CAPABILITY, new FirefoxOptions()); // to add default options - - return $caps; - } - - /** - * @return static - */ - public static function htmlUnit() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::HTMLUNIT, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - } - - /** - * @return static - */ - public static function htmlUnitWithJS() - { - $caps = new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::HTMLUNIT, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - - return $caps->setJavascriptEnabled(true); - } - - /** - * @return static - */ - public static function internetExplorer() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::IE, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::WINDOWS, - ]); - } - - /** - * @return static - */ - public static function microsoftEdge() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::MICROSOFT_EDGE, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::WINDOWS, - ]); - } - - /** - * @return static - */ - public static function iphone() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::IPHONE, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::MAC, - ]); - } - - /** - * @return static - */ - public static function ipad() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::IPAD, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::MAC, - ]); - } - - /** - * @return static - */ - public static function opera() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::OPERA, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - } - - /** - * @return static - */ - public static function safari() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::SAFARI, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - } - - /** - * @deprecated PhantomJS is no longer developed and its support will be removed in next major version. - * Use headless Chrome or Firefox instead. - * @return static - */ - public static function phantomjs() - { - return new static([ - WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::PHANTOMJS, - WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY, - ]); - } - - /** - * @param string $key - * @param mixed $value - * @return DesiredCapabilities - */ - private function set($key, $value) - { - $this->capabilities[$key] = $value; - - return $this; - } - - /** - * @param string $key - * @param mixed $default - * @return mixed - */ - private function get($key, $default = null) - { - return isset($this->capabilities[$key]) - ? $this->capabilities[$key] - : $default; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DriverCommand.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DriverCommand.php deleted file mode 100644 index 97b9090efb..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/DriverCommand.php +++ /dev/null @@ -1,150 +0,0 @@ - ['method' => 'POST', 'url' => '/session/:sessionId/accept_alert'], - DriverCommand::ADD_COOKIE => ['method' => 'POST', 'url' => '/session/:sessionId/cookie'], - DriverCommand::CLEAR_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/clear'], - DriverCommand::CLICK_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/click'], - DriverCommand::CLOSE => ['method' => 'DELETE', 'url' => '/session/:sessionId/window'], - DriverCommand::DELETE_ALL_COOKIES => ['method' => 'DELETE', 'url' => '/session/:sessionId/cookie'], - DriverCommand::DELETE_COOKIE => ['method' => 'DELETE', 'url' => '/session/:sessionId/cookie/:name'], - DriverCommand::DISMISS_ALERT => ['method' => 'POST', 'url' => '/session/:sessionId/dismiss_alert'], - DriverCommand::ELEMENT_EQUALS => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/equals/:other'], - DriverCommand::FIND_CHILD_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/element'], - DriverCommand::FIND_CHILD_ELEMENTS => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/elements'], - DriverCommand::EXECUTE_SCRIPT => ['method' => 'POST', 'url' => '/session/:sessionId/execute'], - DriverCommand::EXECUTE_ASYNC_SCRIPT => ['method' => 'POST', 'url' => '/session/:sessionId/execute_async'], - DriverCommand::FIND_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element'], - DriverCommand::FIND_ELEMENTS => ['method' => 'POST', 'url' => '/session/:sessionId/elements'], - DriverCommand::SWITCH_TO_FRAME => ['method' => 'POST', 'url' => '/session/:sessionId/frame'], - DriverCommand::SWITCH_TO_PARENT_FRAME => ['method' => 'POST', 'url' => '/session/:sessionId/frame/parent'], - DriverCommand::SWITCH_TO_WINDOW => ['method' => 'POST', 'url' => '/session/:sessionId/window'], - DriverCommand::GET => ['method' => 'POST', 'url' => '/session/:sessionId/url'], - DriverCommand::GET_ACTIVE_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/active'], - DriverCommand::GET_ALERT_TEXT => ['method' => 'GET', 'url' => '/session/:sessionId/alert_text'], - DriverCommand::GET_ALL_COOKIES => ['method' => 'GET', 'url' => '/session/:sessionId/cookie'], - DriverCommand::GET_NAMED_COOKIE => ['method' => 'GET', 'url' => '/session/:sessionId/cookie/:name'], - DriverCommand::GET_ALL_SESSIONS => ['method' => 'GET', 'url' => '/sessions'], - DriverCommand::GET_AVAILABLE_LOG_TYPES => ['method' => 'GET', 'url' => '/session/:sessionId/log/types'], - DriverCommand::GET_CURRENT_URL => ['method' => 'GET', 'url' => '/session/:sessionId/url'], - DriverCommand::GET_CURRENT_WINDOW_HANDLE => ['method' => 'GET', 'url' => '/session/:sessionId/window_handle'], - DriverCommand::GET_ELEMENT_ATTRIBUTE => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/attribute/:name', - ], - DriverCommand::GET_ELEMENT_VALUE_OF_CSS_PROPERTY => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/css/:propertyName', - ], - DriverCommand::GET_ELEMENT_LOCATION => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/location', - ], - DriverCommand::GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/location_in_view', - ], - DriverCommand::GET_ELEMENT_SIZE => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/size'], - DriverCommand::GET_ELEMENT_TAG_NAME => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/name'], - DriverCommand::GET_ELEMENT_TEXT => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/text'], - DriverCommand::GET_LOG => ['method' => 'POST', 'url' => '/session/:sessionId/log'], - DriverCommand::GET_PAGE_SOURCE => ['method' => 'GET', 'url' => '/session/:sessionId/source'], - DriverCommand::GET_SCREEN_ORIENTATION => ['method' => 'GET', 'url' => '/session/:sessionId/orientation'], - DriverCommand::GET_CAPABILITIES => ['method' => 'GET', 'url' => '/session/:sessionId'], - DriverCommand::GET_TITLE => ['method' => 'GET', 'url' => '/session/:sessionId/title'], - DriverCommand::GET_WINDOW_HANDLES => ['method' => 'GET', 'url' => '/session/:sessionId/window_handles'], - DriverCommand::GET_WINDOW_POSITION => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/window/:windowHandle/position', - ], - DriverCommand::GET_WINDOW_SIZE => ['method' => 'GET', 'url' => '/session/:sessionId/window/:windowHandle/size'], - DriverCommand::GO_BACK => ['method' => 'POST', 'url' => '/session/:sessionId/back'], - DriverCommand::GO_FORWARD => ['method' => 'POST', 'url' => '/session/:sessionId/forward'], - DriverCommand::IS_ELEMENT_DISPLAYED => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/displayed', - ], - DriverCommand::IS_ELEMENT_ENABLED => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/enabled'], - DriverCommand::IS_ELEMENT_SELECTED => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/selected'], - DriverCommand::MAXIMIZE_WINDOW => [ - 'method' => 'POST', - 'url' => '/session/:sessionId/window/:windowHandle/maximize', - ], - DriverCommand::MOUSE_DOWN => ['method' => 'POST', 'url' => '/session/:sessionId/buttondown'], - DriverCommand::MOUSE_UP => ['method' => 'POST', 'url' => '/session/:sessionId/buttonup'], - DriverCommand::CLICK => ['method' => 'POST', 'url' => '/session/:sessionId/click'], - DriverCommand::DOUBLE_CLICK => ['method' => 'POST', 'url' => '/session/:sessionId/doubleclick'], - DriverCommand::MOVE_TO => ['method' => 'POST', 'url' => '/session/:sessionId/moveto'], - DriverCommand::NEW_SESSION => ['method' => 'POST', 'url' => '/session'], - DriverCommand::QUIT => ['method' => 'DELETE', 'url' => '/session/:sessionId'], - DriverCommand::REFRESH => ['method' => 'POST', 'url' => '/session/:sessionId/refresh'], - DriverCommand::UPLOAD_FILE => ['method' => 'POST', 'url' => '/session/:sessionId/file'], // undocumented - DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/keys'], - DriverCommand::SET_ALERT_VALUE => ['method' => 'POST', 'url' => '/session/:sessionId/alert_text'], - DriverCommand::SEND_KEYS_TO_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/value'], - DriverCommand::IMPLICITLY_WAIT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts/implicit_wait'], - DriverCommand::SET_SCREEN_ORIENTATION => ['method' => 'POST', 'url' => '/session/:sessionId/orientation'], - DriverCommand::SET_TIMEOUT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts'], - DriverCommand::SET_SCRIPT_TIMEOUT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts/async_script'], - DriverCommand::SET_WINDOW_POSITION => [ - 'method' => 'POST', - 'url' => '/session/:sessionId/window/:windowHandle/position', - ], - DriverCommand::SET_WINDOW_SIZE => [ - 'method' => 'POST', - 'url' => '/session/:sessionId/window/:windowHandle/size', - ], - DriverCommand::STATUS => ['method' => 'GET', 'url' => '/status'], - DriverCommand::SUBMIT_ELEMENT => ['method' => 'POST', 'url' => '/session/:sessionId/element/:id/submit'], - DriverCommand::SCREENSHOT => ['method' => 'GET', 'url' => '/session/:sessionId/screenshot'], - DriverCommand::TAKE_ELEMENT_SCREENSHOT => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/screenshot', - ], - DriverCommand::TOUCH_SINGLE_TAP => ['method' => 'POST', 'url' => '/session/:sessionId/touch/click'], - DriverCommand::TOUCH_DOWN => ['method' => 'POST', 'url' => '/session/:sessionId/touch/down'], - DriverCommand::TOUCH_DOUBLE_TAP => ['method' => 'POST', 'url' => '/session/:sessionId/touch/doubleclick'], - DriverCommand::TOUCH_FLICK => ['method' => 'POST', 'url' => '/session/:sessionId/touch/flick'], - DriverCommand::TOUCH_LONG_PRESS => ['method' => 'POST', 'url' => '/session/:sessionId/touch/longclick'], - DriverCommand::TOUCH_MOVE => ['method' => 'POST', 'url' => '/session/:sessionId/touch/move'], - DriverCommand::TOUCH_SCROLL => ['method' => 'POST', 'url' => '/session/:sessionId/touch/scroll'], - DriverCommand::TOUCH_UP => ['method' => 'POST', 'url' => '/session/:sessionId/touch/up'], - DriverCommand::CUSTOM_COMMAND => [], - ]; - /** - * @var array Will be merged with $commands - */ - protected static $w3cCompliantCommands = [ - DriverCommand::ACCEPT_ALERT => ['method' => 'POST', 'url' => '/session/:sessionId/alert/accept'], - DriverCommand::ACTIONS => ['method' => 'POST', 'url' => '/session/:sessionId/actions'], - DriverCommand::DISMISS_ALERT => ['method' => 'POST', 'url' => '/session/:sessionId/alert/dismiss'], - DriverCommand::EXECUTE_ASYNC_SCRIPT => ['method' => 'POST', 'url' => '/session/:sessionId/execute/async'], - DriverCommand::EXECUTE_SCRIPT => ['method' => 'POST', 'url' => '/session/:sessionId/execute/sync'], - DriverCommand::FULLSCREEN_WINDOW => ['method' => 'POST', 'url' => '/session/:sessionId/window/fullscreen'], - DriverCommand::GET_ACTIVE_ELEMENT => ['method' => 'GET', 'url' => '/session/:sessionId/element/active'], - DriverCommand::GET_ALERT_TEXT => ['method' => 'GET', 'url' => '/session/:sessionId/alert/text'], - DriverCommand::GET_CURRENT_WINDOW_HANDLE => ['method' => 'GET', 'url' => '/session/:sessionId/window'], - DriverCommand::GET_ELEMENT_LOCATION => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/rect'], - DriverCommand::GET_ELEMENT_PROPERTY => [ - 'method' => 'GET', - 'url' => '/session/:sessionId/element/:id/property/:name', - ], - DriverCommand::GET_ELEMENT_SIZE => ['method' => 'GET', 'url' => '/session/:sessionId/element/:id/rect'], - DriverCommand::GET_WINDOW_HANDLES => ['method' => 'GET', 'url' => '/session/:sessionId/window/handles'], - DriverCommand::GET_WINDOW_POSITION => ['method' => 'GET', 'url' => '/session/:sessionId/window/rect'], - DriverCommand::GET_WINDOW_SIZE => ['method' => 'GET', 'url' => '/session/:sessionId/window/rect'], - DriverCommand::IMPLICITLY_WAIT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts'], - DriverCommand::MAXIMIZE_WINDOW => ['method' => 'POST', 'url' => '/session/:sessionId/window/maximize'], - DriverCommand::MINIMIZE_WINDOW => ['method' => 'POST', 'url' => '/session/:sessionId/window/minimize'], - DriverCommand::NEW_WINDOW => ['method' => 'POST', 'url' => '/session/:sessionId/window/new'], - DriverCommand::SET_ALERT_VALUE => ['method' => 'POST', 'url' => '/session/:sessionId/alert/text'], - DriverCommand::SET_SCRIPT_TIMEOUT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts'], - DriverCommand::SET_TIMEOUT => ['method' => 'POST', 'url' => '/session/:sessionId/timeouts'], - DriverCommand::SET_WINDOW_SIZE => ['method' => 'POST', 'url' => '/session/:sessionId/window/rect'], - DriverCommand::SET_WINDOW_POSITION => ['method' => 'POST', 'url' => '/session/:sessionId/window/rect'], - ]; - /** - * @var string - */ - protected $url; - /** - * @var resource - */ - protected $curl; - /** - * @var bool - */ - protected $isW3cCompliant = true; - - /** - * @param string $url - * @param string|null $http_proxy - * @param int|null $http_proxy_port - */ - public function __construct($url, $http_proxy = null, $http_proxy_port = null) - { - self::$w3cCompliantCommands = array_merge(self::$commands, self::$w3cCompliantCommands); - - $this->url = $url; - $this->curl = curl_init(); - - if (!empty($http_proxy)) { - curl_setopt($this->curl, CURLOPT_PROXY, $http_proxy); - if ($http_proxy_port !== null) { - curl_setopt($this->curl, CURLOPT_PROXYPORT, $http_proxy_port); - } - } - - // Get credentials from $url (if any) - $matches = null; - if (preg_match("/^(https?:\/\/)(.*):(.*)@(.*?)/U", $url, $matches)) { - $this->url = $matches[1] . $matches[4]; - $auth_creds = $matches[2] . ':' . $matches[3]; - curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - curl_setopt($this->curl, CURLOPT_USERPWD, $auth_creds); - } - - curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($this->curl, CURLOPT_HTTPHEADER, static::DEFAULT_HTTP_HEADERS); - $this->setRequestTimeout(30000); - $this->setConnectionTimeout(30000); - } - - public function disableW3cCompliance() - { - $this->isW3cCompliant = false; - } - - /** - * Set timeout for the connect phase - * - * @param int $timeout_in_ms Timeout in milliseconds - * @return HttpCommandExecutor - */ - public function setConnectionTimeout($timeout_in_ms) - { - // There is a PHP bug in some versions which didn't define the constant. - curl_setopt( - $this->curl, - /* CURLOPT_CONNECTTIMEOUT_MS */ - 156, - $timeout_in_ms - ); - - return $this; - } - - /** - * Set the maximum time of a request - * - * @param int $timeout_in_ms Timeout in milliseconds - * @return HttpCommandExecutor - */ - public function setRequestTimeout($timeout_in_ms) - { - // There is a PHP bug in some versions (at least for PHP 5.3.3) which - // didn't define the constant. - curl_setopt( - $this->curl, - /* CURLOPT_TIMEOUT_MS */ - 155, - $timeout_in_ms - ); - - return $this; - } - - /** - * @param WebDriverCommand $command - * - * @throws WebDriverException - * @return WebDriverResponse - */ - public function execute(WebDriverCommand $command) - { - $http_options = $this->getCommandHttpOptions($command); - $http_method = $http_options['method']; - $url = $http_options['url']; - - $sessionID = $command->getSessionID(); - $url = str_replace(':sessionId', $sessionID === null ? '' : $sessionID, $url); - $params = $command->getParameters(); - foreach ($params as $name => $value) { - if ($name[0] === ':') { - $url = str_replace($name, $value, $url); - unset($params[$name]); - } - } - - if (is_array($params) && !empty($params) && $http_method !== 'POST') { - throw new BadMethodCallException(sprintf( - 'The http method called for %s is %s but it has to be POST' . - ' if you want to pass the JSON params %s', - $url, - $http_method, - json_encode($params) - )); - } - - curl_setopt($this->curl, CURLOPT_URL, $this->url . $url); - - // https://github.com/facebook/php-webdriver/issues/173 - if ($command->getName() === DriverCommand::NEW_SESSION) { - curl_setopt($this->curl, CURLOPT_POST, 1); - } else { - curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, $http_method); - } - - if (in_array($http_method, ['POST', 'PUT'], true)) { - // Disable sending 'Expect: 100-Continue' header, as it is causing issues with eg. squid proxy - // https://tools.ietf.org/html/rfc7231#section-5.1.1 - curl_setopt($this->curl, CURLOPT_HTTPHEADER, array_merge(static::DEFAULT_HTTP_HEADERS, ['Expect:'])); - } else { - curl_setopt($this->curl, CURLOPT_HTTPHEADER, static::DEFAULT_HTTP_HEADERS); - } - - $encoded_params = null; - - if ($http_method === 'POST') { - if (is_array($params) && !empty($params)) { - $encoded_params = json_encode($params); - } elseif ($this->isW3cCompliant) { - // POST body must be valid JSON in W3C, even if empty: https://www.w3.org/TR/webdriver/#processing-model - $encoded_params = '{}'; - } - } - - curl_setopt($this->curl, CURLOPT_POSTFIELDS, $encoded_params); - - $raw_results = trim(curl_exec($this->curl)); - - if ($error = curl_error($this->curl)) { - $msg = sprintf( - 'Curl error thrown for http %s to %s', - $http_method, - $url - ); - if (is_array($params) && !empty($params)) { - $msg .= sprintf(' with params: %s', json_encode($params, JSON_UNESCAPED_SLASHES)); - } - - throw new WebDriverCurlException($msg . "\n\n" . $error); - } - - $results = json_decode($raw_results, true); - - if ($results === null && json_last_error() !== JSON_ERROR_NONE) { - throw new WebDriverException( - sprintf( - "JSON decoding of remote response failed.\n" . - "Error code: %d\n" . - "The response: '%s'\n", - json_last_error(), - $raw_results - ) - ); - } - - $value = null; - if (is_array($results) && array_key_exists('value', $results)) { - $value = $results['value']; - } - - $message = null; - if (is_array($value) && array_key_exists('message', $value)) { - $message = $value['message']; - } - - $sessionId = null; - if (is_array($value) && array_key_exists('sessionId', $value)) { - // W3C's WebDriver - $sessionId = $value['sessionId']; - } elseif (is_array($results) && array_key_exists('sessionId', $results)) { - // Legacy JsonWire - $sessionId = $results['sessionId']; - } - - // @see https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors - if (isset($value['error'])) { - // W3C's WebDriver - WebDriverException::throwException($value['error'], $message, $results); - } - - $status = isset($results['status']) ? $results['status'] : 0; - if ($status !== 0) { - // Legacy JsonWire - WebDriverException::throwException($status, $message, $results); - } - - $response = new WebDriverResponse($sessionId); - - return $response - ->setStatus($status) - ->setValue($value); - } - - /** - * @return string - */ - public function getAddressOfRemoteServer() - { - return $this->url; - } - - /** - * @return array - */ - protected function getCommandHttpOptions(WebDriverCommand $command) - { - $commandName = $command->getName(); - if (!isset(self::$commands[$commandName])) { - if ($this->isW3cCompliant && !isset(self::$w3cCompliantCommands[$commandName])) { - throw new InvalidArgumentException($command->getName() . ' is not a valid command.'); - } - } - - if ($this->isW3cCompliant) { - $raw = self::$w3cCompliantCommands[$command->getName()]; - } else { - $raw = self::$commands[$command->getName()]; - } - - if ($command instanceof CustomWebDriverCommand) { - $url = $command->getCustomUrl(); - $method = $command->getCustomMethod(); - } else { - $url = $raw['url']; - $method = $raw['method']; - } - - return [ - 'url' => $url, - 'method' => $method, - ]; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/JsonWireCompat.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/JsonWireCompat.php deleted file mode 100644 index 65a6956bac..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/JsonWireCompat.php +++ /dev/null @@ -1,89 +0,0 @@ -getMechanism(); - $value = $by->getValue(); - - if ($isW3cCompliant) { - switch ($mechanism) { - // Convert to CSS selectors - case 'class name': - $mechanism = 'css selector'; - $value = sprintf('.%s', self::escapeSelector($value)); - break; - case 'id': - $mechanism = 'css selector'; - $value = sprintf('#%s', self::escapeSelector($value)); - break; - case 'name': - $mechanism = 'css selector'; - $value = sprintf('[name=\'%s\']', self::escapeSelector($value)); - break; - } - } - - return ['using' => $mechanism, 'value' => $value]; - } - - /** - * Escapes a CSS selector. - * - * Code adapted from the Zend Escaper project. - * - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) - * @see https://github.com/zendframework/zend-escaper/blob/master/src/Escaper.php - * - * @param string $selector - * @return string - */ - private static function escapeSelector($selector) - { - return preg_replace_callback('/[^a-z0-9]/iSu', function ($matches) { - $chr = $matches[0]; - if (mb_strlen($chr) === 1) { - $ord = ord($chr); - } else { - $chr = mb_convert_encoding($chr, 'UTF-32BE', 'UTF-8'); - $ord = hexdec(bin2hex($chr)); - } - - return sprintf('\\%X ', $ord); - }, $selector); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/LocalFileDetector.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/LocalFileDetector.php deleted file mode 100644 index ea7e85e011..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/LocalFileDetector.php +++ /dev/null @@ -1,20 +0,0 @@ -driver = $driver; - } - - /** - * @param string $command_name - * @param array $parameters - * @return mixed - */ - public function execute($command_name, array $parameters = []) - { - return $this->driver->execute($command_name, $parameters); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteKeyboard.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteKeyboard.php deleted file mode 100644 index 095b0c5736..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteKeyboard.php +++ /dev/null @@ -1,105 +0,0 @@ -executor = $executor; - $this->driver = $driver; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * Send keys to active element - * @param string|array $keys - * @return $this - */ - public function sendKeys($keys) - { - if ($this->isW3cCompliant) { - $activeElement = $this->driver->switchTo()->activeElement(); - $activeElement->sendKeys($keys); - } else { - $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [ - 'value' => WebDriverKeys::encode($keys), - ]); - } - - return $this; - } - - /** - * Press a modifier key - * - * @see WebDriverKeys - * @param string $key - * @return $this - */ - public function pressKey($key) - { - if ($this->isW3cCompliant) { - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'key', - 'id' => 'keyboard', - 'actions' => [['type' => 'keyDown', 'value' => $key]], - ], - ], - ]); - } else { - $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [ - 'value' => [(string) $key], - ]); - } - - return $this; - } - - /** - * Release a modifier key - * - * @see WebDriverKeys - * @param string $key - * @return $this - */ - public function releaseKey($key) - { - if ($this->isW3cCompliant) { - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'key', - 'id' => 'keyboard', - 'actions' => [['type' => 'keyUp', 'value' => $key]], - ], - ], - ]); - } else { - $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, [ - 'value' => [(string) $key], - ]); - } - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteMouse.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteMouse.php deleted file mode 100644 index d2429967ee..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteMouse.php +++ /dev/null @@ -1,306 +0,0 @@ -executor = $executor; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * @param null|WebDriverCoordinates $where - * - * @return RemoteMouse - */ - public function click(WebDriverCoordinates $where = null) - { - if ($this->isW3cCompliant) { - $moveAction = $where ? [$this->createMoveAction($where)] : []; - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => array_merge($moveAction, $this->createClickActions()), - ], - ], - ]); - - return $this; - } - - $this->moveIfNeeded($where); - $this->executor->execute(DriverCommand::CLICK, [ - 'button' => self::BUTTON_LEFT, - ]); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - * - * @return RemoteMouse - */ - public function contextClick(WebDriverCoordinates $where = null) - { - if ($this->isW3cCompliant) { - $moveAction = $where ? [$this->createMoveAction($where)] : []; - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => array_merge($moveAction, [ - [ - 'type' => 'pointerDown', - 'button' => self::BUTTON_RIGHT, - ], - [ - 'type' => 'pointerUp', - 'button' => self::BUTTON_RIGHT, - ], - ]), - ], - ], - ]); - - return $this; - } - - $this->moveIfNeeded($where); - $this->executor->execute(DriverCommand::CLICK, [ - 'button' => self::BUTTON_RIGHT, - ]); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - * - * @return RemoteMouse - */ - public function doubleClick(WebDriverCoordinates $where = null) - { - if ($this->isW3cCompliant) { - $clickActions = $this->createClickActions(); - $moveAction = $where === null ? [] : [$this->createMoveAction($where)]; - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => array_merge($moveAction, $clickActions, $clickActions), - ], - ], - ]); - - return $this; - } - - $this->moveIfNeeded($where); - $this->executor->execute(DriverCommand::DOUBLE_CLICK); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - * - * @return RemoteMouse - */ - public function mouseDown(WebDriverCoordinates $where = null) - { - if ($this->isW3cCompliant) { - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => [ - $this->createMoveAction($where), - [ - 'type' => 'pointerDown', - 'button' => self::BUTTON_LEFT, - ], - ], - ], - ], - ]); - - return $this; - } - - $this->moveIfNeeded($where); - $this->executor->execute(DriverCommand::MOUSE_DOWN); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - * @param int|null $x_offset - * @param int|null $y_offset - * - * @return RemoteMouse - */ - public function mouseMove( - WebDriverCoordinates $where = null, - $x_offset = null, - $y_offset = null - ) { - if ($this->isW3cCompliant) { - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => [$this->createMoveAction($where, $x_offset, $y_offset)], - ], - ], - ]); - - return $this; - } - - $params = []; - if ($where !== null) { - $params['element'] = $where->getAuxiliary(); - } - if ($x_offset !== null) { - $params['xoffset'] = $x_offset; - } - if ($y_offset !== null) { - $params['yoffset'] = $y_offset; - } - - $this->executor->execute(DriverCommand::MOVE_TO, $params); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - * - * @return RemoteMouse - */ - public function mouseUp(WebDriverCoordinates $where = null) - { - if ($this->isW3cCompliant) { - $moveAction = $where ? [$this->createMoveAction($where)] : []; - - $this->executor->execute(DriverCommand::ACTIONS, [ - 'actions' => [ - [ - 'type' => 'pointer', - 'id' => 'mouse', - 'parameters' => ['pointerType' => 'mouse'], - 'actions' => array_merge($moveAction, [ - [ - 'type' => 'pointerUp', - 'button' => self::BUTTON_LEFT, - ], - ]), - ], - ], - ]); - - return $this; - } - - $this->moveIfNeeded($where); - $this->executor->execute(DriverCommand::MOUSE_UP); - - return $this; - } - - /** - * @param WebDriverCoordinates $where - */ - protected function moveIfNeeded(WebDriverCoordinates $where = null) - { - if ($where) { - $this->mouseMove($where); - } - } - - /** - * @param WebDriverCoordinates $where - * @param int|null $x_offset - * @param int|null $y_offset - * - * @return array - */ - private function createMoveAction( - WebDriverCoordinates $where = null, - $x_offset = null, - $y_offset = null - ) { - $move_action = [ - 'type' => 'pointerMove', - 'duration' => 100, // to simulate human delay - 'x' => $x_offset === null ? 0 : $x_offset, - 'y' => $y_offset === null ? 0 : $y_offset, - ]; - - if ($where !== null) { - $move_action['origin'] = [JsonWireCompat::WEB_DRIVER_ELEMENT_IDENTIFIER => $where->getAuxiliary()]; - } else { - $move_action['origin'] = 'pointer'; - } - - return $move_action; - } - - /** - * @return array - */ - private function createClickActions() - { - return [ - [ - 'type' => 'pointerDown', - 'button' => self::BUTTON_LEFT, - ], - [ - 'type' => 'pointerUp', - 'button' => self::BUTTON_LEFT, - ], - ]; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteStatus.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteStatus.php deleted file mode 100644 index 3d123bd459..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteStatus.php +++ /dev/null @@ -1,80 +0,0 @@ -isReady = (bool) $isReady; - $this->message = (string) $message; - - $this->setMeta($meta); - } - - /** - * @param array $responseBody - * @return RemoteStatus - */ - public static function createFromResponse(array $responseBody) - { - $object = new static($responseBody['ready'], $responseBody['message'], $responseBody); - - return $object; - } - - /** - * The remote end's readiness state. - * False if an attempt to create a session at the current time would fail. - * However, the value true does not guarantee that a New Session command will succeed. - * - * @return bool - */ - public function isReady() - { - return $this->isReady; - } - - /** - * An implementation-defined string explaining the remote end's readiness state. - * - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * Arbitrary meta information specific to remote-end implementation. - * - * @return array - */ - public function getMeta() - { - return $this->meta; - } - - protected function setMeta(array $meta) - { - unset($meta['ready'], $meta['message']); - - $this->meta = $meta; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTargetLocator.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTargetLocator.php deleted file mode 100644 index 5b98813715..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTargetLocator.php +++ /dev/null @@ -1,149 +0,0 @@ -executor = $executor; - $this->driver = $driver; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * @return RemoteWebDriver - */ - public function defaultContent() - { - $params = ['id' => null]; - $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params); - - return $this->driver; - } - - /** - * @param WebDriverElement|null|int|string $frame The WebDriverElement, the id or the name of the frame. - * When null, switch to the current top-level browsing context When int, switch to the WindowProxy identified - * by the value. When an Element, switch to that Element. - * @return RemoteWebDriver - */ - public function frame($frame) - { - if ($this->isW3cCompliant) { - if ($frame instanceof WebDriverElement) { - $id = [JsonWireCompat::WEB_DRIVER_ELEMENT_IDENTIFIER => $frame->getID()]; - } elseif ($frame === null) { - $id = null; - } elseif (is_int($frame)) { - $id = $frame; - } else { - throw new \InvalidArgumentException( - 'In W3C compliance mode frame must be either instance of WebDriverElement, integer or null' - ); - } - } else { - if ($frame instanceof WebDriverElement) { - $id = ['ELEMENT' => $frame->getID()]; - } elseif ($frame === null) { - $id = null; - } elseif (is_int($frame)) { - $id = $frame; - } else { - $id = (string) $frame; - } - } - - $params = ['id' => $id]; - $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params); - - return $this->driver; - } - - /** - * Switch to the parent iframe. - * - * @return RemoteWebDriver This driver focused on the parent frame - */ - public function parent() - { - $this->executor->execute(DriverCommand::SWITCH_TO_PARENT_FRAME, []); - - return $this->driver; - } - - /** - * @param string $handle The handle of the window to be focused on. - * @return RemoteWebDriver - */ - public function window($handle) - { - if ($this->isW3cCompliant) { - $params = ['handle' => (string) $handle]; - } else { - $params = ['name' => (string) $handle]; - } - - $this->executor->execute(DriverCommand::SWITCH_TO_WINDOW, $params); - - return $this->driver; - } - - /** - * Creates a new browser window and switches the focus for future commands of this driver to the new window. - * - * @see https://w3c.github.io/webdriver/#new-window - * @param string $windowType The type of a new browser window that should be created. One of [tab, window]. - * The created window is not guaranteed to be of the requested type; if the driver does not support the requested - * type, a new browser window will be created of whatever type the driver does support. - * @throws UnsupportedOperationException - * @return RemoteWebDriver This driver focused on the given window - */ - public function newWindow($windowType = self::WINDOW_TYPE_TAB) - { - if ($windowType !== self::WINDOW_TYPE_TAB && $windowType !== self::WINDOW_TYPE_WINDOW) { - throw new \InvalidArgumentException('Window type must by either "tab" or "window"'); - } - - if (!$this->isW3cCompliant) { - throw new UnsupportedOperationException('New window is only supported in W3C mode'); - } - - $response = $this->executor->execute(DriverCommand::NEW_WINDOW, ['type' => $windowType]); - - $this->window($response['handle']); - - return $this->driver; - } - - public function alert() - { - return new WebDriverAlert($this->executor); - } - - /** - * @return RemoteWebElement - */ - public function activeElement() - { - $response = $this->driver->execute(DriverCommand::GET_ACTIVE_ELEMENT, []); - $method = new RemoteExecuteMethod($this->driver); - - return new RemoteWebElement($method, JsonWireCompat::getElement($response), $this->isW3cCompliant); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTouchScreen.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTouchScreen.php deleted file mode 100644 index 889c12e6cb..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteTouchScreen.php +++ /dev/null @@ -1,188 +0,0 @@ -executor = $executor; - } - - /** - * @param WebDriverElement $element - * - * @return RemoteTouchScreen The instance. - */ - public function tap(WebDriverElement $element) - { - $this->executor->execute( - DriverCommand::TOUCH_SINGLE_TAP, - ['element' => $element->getID()] - ); - - return $this; - } - - /** - * @param WebDriverElement $element - * - * @return RemoteTouchScreen The instance. - */ - public function doubleTap(WebDriverElement $element) - { - $this->executor->execute( - DriverCommand::TOUCH_DOUBLE_TAP, - ['element' => $element->getID()] - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * - * @return RemoteTouchScreen The instance. - */ - public function down($x, $y) - { - $this->executor->execute(DriverCommand::TOUCH_DOWN, [ - 'x' => $x, - 'y' => $y, - ]); - - return $this; - } - - /** - * @param int $xspeed - * @param int $yspeed - * - * @return RemoteTouchScreen The instance. - */ - public function flick($xspeed, $yspeed) - { - $this->executor->execute(DriverCommand::TOUCH_FLICK, [ - 'xspeed' => $xspeed, - 'yspeed' => $yspeed, - ]); - - return $this; - } - - /** - * @param WebDriverElement $element - * @param int $xoffset - * @param int $yoffset - * @param int $speed - * - * @return RemoteTouchScreen The instance. - */ - public function flickFromElement(WebDriverElement $element, $xoffset, $yoffset, $speed) - { - $this->executor->execute(DriverCommand::TOUCH_FLICK, [ - 'xoffset' => $xoffset, - 'yoffset' => $yoffset, - 'element' => $element->getID(), - 'speed' => $speed, - ]); - - return $this; - } - - /** - * @param WebDriverElement $element - * - * @return RemoteTouchScreen The instance. - */ - public function longPress(WebDriverElement $element) - { - $this->executor->execute( - DriverCommand::TOUCH_LONG_PRESS, - ['element' => $element->getID()] - ); - - return $this; - } - - /** - * @param int $x - * @param int $y - * - * @return RemoteTouchScreen The instance. - */ - public function move($x, $y) - { - $this->executor->execute(DriverCommand::TOUCH_MOVE, [ - 'x' => $x, - 'y' => $y, - ]); - - return $this; - } - - /** - * @param int $xoffset - * @param int $yoffset - * - * @return RemoteTouchScreen The instance. - */ - public function scroll($xoffset, $yoffset) - { - $this->executor->execute(DriverCommand::TOUCH_SCROLL, [ - 'xoffset' => $xoffset, - 'yoffset' => $yoffset, - ]); - - return $this; - } - - /** - * @param WebDriverElement $element - * @param int $xoffset - * @param int $yoffset - * - * @return RemoteTouchScreen The instance. - */ - public function scrollFromElement(WebDriverElement $element, $xoffset, $yoffset) - { - $this->executor->execute(DriverCommand::TOUCH_SCROLL, [ - 'element' => $element->getID(), - 'xoffset' => $xoffset, - 'yoffset' => $yoffset, - ]); - - return $this; - } - - /** - * @param int $x - * @param int $y - * - * @return RemoteTouchScreen The instance. - */ - public function up($x, $y) - { - $this->executor->execute(DriverCommand::TOUCH_UP, [ - 'x' => $x, - 'y' => $y, - ]); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php deleted file mode 100644 index 9bc3c7a891..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php +++ /dev/null @@ -1,723 +0,0 @@ -executor = $commandExecutor; - $this->sessionID = $sessionId; - $this->isW3cCompliant = $isW3cCompliant; - - if ($capabilities !== null) { - $this->capabilities = $capabilities; - } - } - - /** - * Construct the RemoteWebDriver by a desired capabilities. - * - * @param string $selenium_server_url The url of the remote Selenium WebDriver server - * @param DesiredCapabilities|array $desired_capabilities The desired capabilities - * @param int|null $connection_timeout_in_ms Set timeout for the connect phase to remote Selenium WebDriver server - * @param int|null $request_timeout_in_ms Set the maximum time of a request to remote Selenium WebDriver server - * @param string|null $http_proxy The proxy to tunnel requests to the remote Selenium WebDriver through - * @param int|null $http_proxy_port The proxy port to tunnel requests to the remote Selenium WebDriver through - * @param DesiredCapabilities $required_capabilities The required capabilities - * - * @return static - */ - public static function create( - $selenium_server_url = 'http://localhost:4444/wd/hub', - $desired_capabilities = null, - $connection_timeout_in_ms = null, - $request_timeout_in_ms = null, - $http_proxy = null, - $http_proxy_port = null, - DesiredCapabilities $required_capabilities = null - ) { - $selenium_server_url = preg_replace('#/+$#', '', $selenium_server_url); - - $desired_capabilities = self::castToDesiredCapabilitiesObject($desired_capabilities); - - $executor = new HttpCommandExecutor($selenium_server_url, $http_proxy, $http_proxy_port); - if ($connection_timeout_in_ms !== null) { - $executor->setConnectionTimeout($connection_timeout_in_ms); - } - if ($request_timeout_in_ms !== null) { - $executor->setRequestTimeout($request_timeout_in_ms); - } - - // W3C - $parameters = [ - 'capabilities' => [ - 'firstMatch' => [(object) $desired_capabilities->toW3cCompatibleArray()], - ], - ]; - - if ($required_capabilities !== null && !empty($required_capabilities->toArray())) { - $parameters['capabilities']['alwaysMatch'] = (object) $required_capabilities->toW3cCompatibleArray(); - } - - // Legacy protocol - if ($required_capabilities !== null) { - // TODO: Selenium (as of v3.0.1) does accept requiredCapabilities only as a property of desiredCapabilities. - // This has changed with the W3C WebDriver spec, but is the only way how to pass these - // values with the legacy protocol. - $desired_capabilities->setCapability('requiredCapabilities', (object) $required_capabilities->toArray()); - } - - $parameters['desiredCapabilities'] = (object) $desired_capabilities->toArray(); - - $command = WebDriverCommand::newSession($parameters); - - $response = $executor->execute($command); - - return static::createFromResponse($response, $executor); - } - - /** - * [Experimental] Construct the RemoteWebDriver by an existing session. - * - * This constructor can boost the performance a lot by reusing the same browser for the whole test suite. - * You cannot pass the desired capabilities because the session was created before. - * - * @param string $selenium_server_url The url of the remote Selenium WebDriver server - * @param string $session_id The existing session id - * @param int|null $connection_timeout_in_ms Set timeout for the connect phase to remote Selenium WebDriver server - * @param int|null $request_timeout_in_ms Set the maximum time of a request to remote Selenium WebDriver server - * @param bool $isW3cCompliant True to use W3C WebDriver (default), false to use the legacy JsonWire protocol - * @return static - */ - public static function createBySessionID( - $session_id, - $selenium_server_url = 'http://localhost:4444/wd/hub', - $connection_timeout_in_ms = null, - $request_timeout_in_ms = null - ) { - // BC layer to not break the method signature - $isW3cCompliant = func_num_args() > 4 ? func_get_arg(4) : true; - - $executor = new HttpCommandExecutor($selenium_server_url, null, null); - if ($connection_timeout_in_ms !== null) { - $executor->setConnectionTimeout($connection_timeout_in_ms); - } - if ($request_timeout_in_ms !== null) { - $executor->setRequestTimeout($request_timeout_in_ms); - } - - if (!$isW3cCompliant) { - $executor->disableW3cCompliance(); - } - - return new static($executor, $session_id, null, $isW3cCompliant); - } - - /** - * Close the current window. - * - * @return RemoteWebDriver The current instance. - */ - public function close() - { - $this->execute(DriverCommand::CLOSE, []); - - return $this; - } - - /** - * Create a new top-level browsing context. - * - * @codeCoverageIgnore - * @deprecated Use $driver->switchTo()->newWindow() - * @return WebDriver The current instance. - */ - public function newWindow() - { - return $this->switchTo()->newWindow(); - } - - /** - * Find the first WebDriverElement using the given mechanism. - * - * @param WebDriverBy $by - * @return RemoteWebElement NoSuchElementException is thrown in HttpCommandExecutor if no element is found. - * @see WebDriverBy - */ - public function findElement(WebDriverBy $by) - { - $raw_element = $this->execute( - DriverCommand::FIND_ELEMENT, - JsonWireCompat::getUsing($by, $this->isW3cCompliant) - ); - - return $this->newElement(JsonWireCompat::getElement($raw_element)); - } - - /** - * Find all WebDriverElements within the current page using the given mechanism. - * - * @param WebDriverBy $by - * @return RemoteWebElement[] A list of all WebDriverElements, or an empty array if nothing matches - * @see WebDriverBy - */ - public function findElements(WebDriverBy $by) - { - $raw_elements = $this->execute( - DriverCommand::FIND_ELEMENTS, - JsonWireCompat::getUsing($by, $this->isW3cCompliant) - ); - - $elements = []; - foreach ($raw_elements as $raw_element) { - $elements[] = $this->newElement(JsonWireCompat::getElement($raw_element)); - } - - return $elements; - } - - /** - * Load a new web page in the current browser window. - * - * @param string $url - * - * @return RemoteWebDriver The current instance. - */ - public function get($url) - { - $params = ['url' => (string) $url]; - $this->execute(DriverCommand::GET, $params); - - return $this; - } - - /** - * Get a string representing the current URL that the browser is looking at. - * - * @return string The current URL. - */ - public function getCurrentURL() - { - return $this->execute(DriverCommand::GET_CURRENT_URL); - } - - /** - * Get the source of the last loaded page. - * - * @return string The current page source. - */ - public function getPageSource() - { - return $this->execute(DriverCommand::GET_PAGE_SOURCE); - } - - /** - * Get the title of the current page. - * - * @return string The title of the current page. - */ - public function getTitle() - { - return $this->execute(DriverCommand::GET_TITLE); - } - - /** - * Return an opaque handle to this window that uniquely identifies it within this driver instance. - * - * @return string The current window handle. - */ - public function getWindowHandle() - { - return $this->execute( - DriverCommand::GET_CURRENT_WINDOW_HANDLE, - [] - ); - } - - /** - * Get all window handles available to the current session. - * - * Note: Do not use `end($driver->getWindowHandles())` to find the last open window, for proper solution see: - * https://github.com/php-webdriver/php-webdriver/wiki/Alert,-tabs,-frames,-iframes#switch-to-the-new-window - * - * @return array An array of string containing all available window handles. - */ - public function getWindowHandles() - { - return $this->execute(DriverCommand::GET_WINDOW_HANDLES, []); - } - - /** - * Quits this driver, closing every associated window. - */ - public function quit() - { - $this->execute(DriverCommand::QUIT); - $this->executor = null; - } - - /** - * Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. - * The executed script is assumed to be synchronous and the result of evaluating the script will be returned. - * - * @param string $script The script to inject. - * @param array $arguments The arguments of the script. - * @return mixed The return value of the script. - */ - public function executeScript($script, array $arguments = []) - { - $params = [ - 'script' => $script, - 'args' => $this->prepareScriptArguments($arguments), - ]; - - return $this->execute(DriverCommand::EXECUTE_SCRIPT, $params); - } - - /** - * Inject a snippet of JavaScript into the page for asynchronous execution in the context of the currently selected - * frame. - * - * The driver will pass a callback as the last argument to the snippet, and block until the callback is invoked. - * - * You may need to define script timeout using `setScriptTimeout()` method of `WebDriverTimeouts` first. - * - * @param string $script The script to inject. - * @param array $arguments The arguments of the script. - * @return mixed The value passed by the script to the callback. - */ - public function executeAsyncScript($script, array $arguments = []) - { - $params = [ - 'script' => $script, - 'args' => $this->prepareScriptArguments($arguments), - ]; - - return $this->execute( - DriverCommand::EXECUTE_ASYNC_SCRIPT, - $params - ); - } - - /** - * Take a screenshot of the current page. - * - * @param string $save_as The path of the screenshot to be saved. - * @return string The screenshot in PNG format. - */ - public function takeScreenshot($save_as = null) - { - $screenshot = base64_decode($this->execute(DriverCommand::SCREENSHOT), true); - - if ($save_as !== null) { - $directoryPath = dirname($save_as); - - if (!file_exists($directoryPath)) { - mkdir($directoryPath, 0777, true); - } - - file_put_contents($save_as, $screenshot); - } - - return $screenshot; - } - - /** - * Status returns information about whether a remote end is in a state in which it can create new sessions. - */ - public function getStatus() - { - $response = $this->execute(DriverCommand::STATUS); - - return RemoteStatus::createFromResponse($response); - } - - /** - * Construct a new WebDriverWait by the current WebDriver instance. - * Sample usage: - * - * ``` - * $driver->wait(20, 1000)->until( - * WebDriverExpectedCondition::titleIs('WebDriver Page') - * ); - * ``` - * @param int $timeout_in_second - * @param int $interval_in_millisecond - * - * @return WebDriverWait - */ - public function wait($timeout_in_second = 30, $interval_in_millisecond = 250) - { - return new WebDriverWait( - $this, - $timeout_in_second, - $interval_in_millisecond - ); - } - - /** - * An abstraction for managing stuff you would do in a browser menu. For example, adding and deleting cookies. - * - * @return WebDriverOptions - */ - public function manage() - { - return new WebDriverOptions($this->getExecuteMethod(), $this->isW3cCompliant); - } - - /** - * An abstraction allowing the driver to access the browser's history and to navigate to a given URL. - * - * @return WebDriverNavigation - * @see WebDriverNavigation - */ - public function navigate() - { - return new WebDriverNavigation($this->getExecuteMethod()); - } - - /** - * Switch to a different window or frame. - * - * @return RemoteTargetLocator - * @see RemoteTargetLocator - */ - public function switchTo() - { - return new RemoteTargetLocator($this->getExecuteMethod(), $this, $this->isW3cCompliant); - } - - /** - * @return RemoteMouse - */ - public function getMouse() - { - if (!$this->mouse) { - $this->mouse = new RemoteMouse($this->getExecuteMethod(), $this->isW3cCompliant); - } - - return $this->mouse; - } - - /** - * @return RemoteKeyboard - */ - public function getKeyboard() - { - if (!$this->keyboard) { - $this->keyboard = new RemoteKeyboard($this->getExecuteMethod(), $this, $this->isW3cCompliant); - } - - return $this->keyboard; - } - - /** - * @return RemoteTouchScreen - */ - public function getTouch() - { - if (!$this->touch) { - $this->touch = new RemoteTouchScreen($this->getExecuteMethod()); - } - - return $this->touch; - } - - /** - * Construct a new action builder. - * - * @return WebDriverActions - */ - public function action() - { - return new WebDriverActions($this); - } - - /** - * Set the command executor of this RemoteWebdriver - * - * @deprecated To be removed in the future. Executor should be passed in the constructor. - * @internal - * @codeCoverageIgnore - * @param WebDriverCommandExecutor $executor Despite the typehint, it have be an instance of HttpCommandExecutor. - * @return RemoteWebDriver - */ - public function setCommandExecutor(WebDriverCommandExecutor $executor) - { - $this->executor = $executor; - - return $this; - } - - /** - * Get the command executor of this RemoteWebdriver - * - * @return HttpCommandExecutor - */ - public function getCommandExecutor() - { - return $this->executor; - } - - /** - * Set the session id of the RemoteWebDriver. - * - * @deprecated To be removed in the future. Session ID should be passed in the constructor. - * @internal - * @codeCoverageIgnore - * @param string $session_id - * @return RemoteWebDriver - */ - public function setSessionID($session_id) - { - $this->sessionID = $session_id; - - return $this; - } - - /** - * Get current selenium sessionID - * - * @return string - */ - public function getSessionID() - { - return $this->sessionID; - } - - /** - * Get capabilities of the RemoteWebDriver. - * - * @return WebDriverCapabilities - */ - public function getCapabilities() - { - return $this->capabilities; - } - - /** - * Returns a list of the currently active sessions. - * - * @param string $selenium_server_url The url of the remote Selenium WebDriver server - * @param int $timeout_in_ms - * @return array - */ - public static function getAllSessions($selenium_server_url = 'http://localhost:4444/wd/hub', $timeout_in_ms = 30000) - { - $executor = new HttpCommandExecutor($selenium_server_url, null, null); - $executor->setConnectionTimeout($timeout_in_ms); - - $command = new WebDriverCommand( - null, - DriverCommand::GET_ALL_SESSIONS, - [] - ); - - return $executor->execute($command)->getValue(); - } - - public function execute($command_name, $params = []) - { - $command = new WebDriverCommand( - $this->sessionID, - $command_name, - $params - ); - - if ($this->executor) { - $response = $this->executor->execute($command); - - return $response->getValue(); - } - - return null; - } - - /** - * Execute custom commands on remote end. - * For example vendor-specific commands or other commands not implemented by php-webdriver. - * - * @see https://github.com/php-webdriver/php-webdriver/wiki/Custom-commands - * @param string $endpointUrl - * @param string $method - * @param array $params - * @return mixed|null - */ - public function executeCustomCommand($endpointUrl, $method = 'GET', $params = []) - { - $command = new CustomWebDriverCommand( - $this->sessionID, - $endpointUrl, - $method, - $params - ); - - if ($this->executor) { - $response = $this->executor->execute($command); - - return $response->getValue(); - } - - return null; - } - - /** - * @internal - * @return bool - */ - public function isW3cCompliant() - { - return $this->isW3cCompliant; - } - - /** - * Create instance based on response to NEW_SESSION command. - * Also detect W3C/OSS dialect and setup the driver/executor accordingly. - * - * @internal - * @return static - */ - protected static function createFromResponse(WebDriverResponse $response, HttpCommandExecutor $commandExecutor) - { - $responseValue = $response->getValue(); - - if (!$isW3cCompliant = isset($responseValue['capabilities'])) { - $commandExecutor->disableW3cCompliance(); - } - - if ($isW3cCompliant) { - $returnedCapabilities = DesiredCapabilities::createFromW3cCapabilities($responseValue['capabilities']); - } else { - $returnedCapabilities = new DesiredCapabilities($responseValue); - } - - return new static($commandExecutor, $response->getSessionID(), $returnedCapabilities, $isW3cCompliant); - } - - /** - * Prepare arguments for JavaScript injection - * - * @param array $arguments - * @return array - */ - protected function prepareScriptArguments(array $arguments) - { - $args = []; - foreach ($arguments as $key => $value) { - if ($value instanceof WebDriverElement) { - $args[$key] = [ - $this->isW3cCompliant ? - JsonWireCompat::WEB_DRIVER_ELEMENT_IDENTIFIER - : 'ELEMENT' => $value->getID(), - ]; - } else { - if (is_array($value)) { - $value = $this->prepareScriptArguments($value); - } - $args[$key] = $value; - } - } - - return $args; - } - - /** - * @return RemoteExecuteMethod - */ - protected function getExecuteMethod() - { - if (!$this->executeMethod) { - $this->executeMethod = new RemoteExecuteMethod($this); - } - - return $this->executeMethod; - } - - /** - * Return the WebDriverElement with the given id. - * - * @param string $id The id of the element to be created. - * @return RemoteWebElement - */ - protected function newElement($id) - { - return new RemoteWebElement($this->getExecuteMethod(), $id, $this->isW3cCompliant); - } - - /** - * Cast legacy types (array or null) to DesiredCapabilities object. To be removed in future when instance of - * DesiredCapabilities will be required. - * - * @param array|DesiredCapabilities|null $desired_capabilities - * @return DesiredCapabilities - */ - protected static function castToDesiredCapabilitiesObject($desired_capabilities = null) - { - if ($desired_capabilities === null) { - return new DesiredCapabilities(); - } - - if (is_array($desired_capabilities)) { - return new DesiredCapabilities($desired_capabilities); - } - - return $desired_capabilities; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebElement.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebElement.php deleted file mode 100644 index e0503698e4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/RemoteWebElement.php +++ /dev/null @@ -1,643 +0,0 @@ -executor = $executor; - $this->id = $id; - $this->fileDetector = new UselessFileDetector(); - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * Clear content editable or resettable element - * - * @return RemoteWebElement The current instance. - */ - public function clear() - { - $this->executor->execute( - DriverCommand::CLEAR_ELEMENT, - [':id' => $this->id] - ); - - return $this; - } - - /** - * Click this element. - * - * @return RemoteWebElement The current instance. - */ - public function click() - { - try { - $this->executor->execute( - DriverCommand::CLICK_ELEMENT, - [':id' => $this->id] - ); - } catch (ElementNotInteractableException $e) { - // An issue with geckodriver (https://github.com/mozilla/geckodriver/issues/653) prevents clicking on a link - // if the first child is a block-level element. - // The workaround in this case is to click on a child element. - $this->clickChildElement($e); - } - - return $this; - } - - /** - * Find the first WebDriverElement within this element using the given mechanism. - * - * When using xpath be aware that webdriver follows standard conventions: a search prefixed with "//" will - * search the entire document from the root, not just the children (relative context) of this current node. - * Use ".//" to limit your search to the children of this element. - * - * @param WebDriverBy $by - * @return RemoteWebElement NoSuchElementException is thrown in HttpCommandExecutor if no element is found. - * @see WebDriverBy - */ - public function findElement(WebDriverBy $by) - { - $params = JsonWireCompat::getUsing($by, $this->isW3cCompliant); - $params[':id'] = $this->id; - - $raw_element = $this->executor->execute( - DriverCommand::FIND_CHILD_ELEMENT, - $params - ); - - return $this->newElement(JsonWireCompat::getElement($raw_element)); - } - - /** - * Find all WebDriverElements within this element using the given mechanism. - * - * When using xpath be aware that webdriver follows standard conventions: a search prefixed with "//" will - * search the entire document from the root, not just the children (relative context) of this current node. - * Use ".//" to limit your search to the children of this element. - * - * @param WebDriverBy $by - * @return RemoteWebElement[] A list of all WebDriverElements, or an empty - * array if nothing matches - * @see WebDriverBy - */ - public function findElements(WebDriverBy $by) - { - $params = JsonWireCompat::getUsing($by, $this->isW3cCompliant); - $params[':id'] = $this->id; - $raw_elements = $this->executor->execute( - DriverCommand::FIND_CHILD_ELEMENTS, - $params - ); - - $elements = []; - foreach ($raw_elements as $raw_element) { - $elements[] = $this->newElement(JsonWireCompat::getElement($raw_element)); - } - - return $elements; - } - - /** - * Get the value of the given attribute of the element. - * Attribute is meant what is declared in the HTML markup of the element. - * To read a value of a IDL "JavaScript" property (like `innerHTML`), use `getDomProperty()` method. - * - * @param string $attribute_name The name of the attribute. - * @return string|true|null The value of the attribute. If this is boolean attribute, return true if the element - * has it, otherwise return null. - */ - public function getAttribute($attribute_name) - { - $params = [ - ':name' => $attribute_name, - ':id' => $this->id, - ]; - - if ($this->isW3cCompliant && ($attribute_name === 'value' || $attribute_name === 'index')) { - $value = $this->executor->execute(DriverCommand::GET_ELEMENT_PROPERTY, $params); - - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; - } - - if ($value !== null) { - return (string) $value; - } - } - - return $this->executor->execute(DriverCommand::GET_ELEMENT_ATTRIBUTE, $params); - } - - /** - * Gets the value of a IDL JavaScript property of this element (for example `innerHTML`, `tagName` etc.). - * - * @see https://developer.mozilla.org/en-US/docs/Glossary/IDL - * @see https://developer.mozilla.org/en-US/docs/Web/API/Element#properties - * @param string $propertyName - * @return mixed|null The property's current value or null if the value is not set or the property does not exist. - */ - public function getDomProperty($propertyName) - { - if (!$this->isW3cCompliant) { - throw new UnsupportedOperationException('This method is only supported in W3C mode'); - } - - $params = [ - ':name' => $propertyName, - ':id' => $this->id, - ]; - - return $this->executor->execute(DriverCommand::GET_ELEMENT_PROPERTY, $params); - } - - /** - * Get the value of a given CSS property. - * - * @param string $css_property_name The name of the CSS property. - * @return string The value of the CSS property. - */ - public function getCSSValue($css_property_name) - { - $params = [ - ':propertyName' => $css_property_name, - ':id' => $this->id, - ]; - - return $this->executor->execute( - DriverCommand::GET_ELEMENT_VALUE_OF_CSS_PROPERTY, - $params - ); - } - - /** - * Get the location of element relative to the top-left corner of the page. - * - * @return WebDriverPoint The location of the element. - */ - public function getLocation() - { - $location = $this->executor->execute( - DriverCommand::GET_ELEMENT_LOCATION, - [':id' => $this->id] - ); - - return new WebDriverPoint($location['x'], $location['y']); - } - - /** - * Try scrolling the element into the view port and return the location of - * element relative to the top-left corner of the page afterwards. - * - * @return WebDriverPoint The location of the element. - */ - public function getLocationOnScreenOnceScrolledIntoView() - { - if ($this->isW3cCompliant) { - $script = <<executor->execute(DriverCommand::EXECUTE_SCRIPT, [ - 'script' => $script, - 'args' => [[JsonWireCompat::WEB_DRIVER_ELEMENT_IDENTIFIER => $this->id]], - ]); - $location = ['x' => $result['x'], 'y' => $result['y']]; - } else { - $location = $this->executor->execute( - DriverCommand::GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW, - [':id' => $this->id] - ); - } - - return new WebDriverPoint($location['x'], $location['y']); - } - - /** - * @return WebDriverCoordinates - */ - public function getCoordinates() - { - $element = $this; - - $on_screen = null; // planned but not yet implemented - $in_view_port = static function () use ($element) { - return $element->getLocationOnScreenOnceScrolledIntoView(); - }; - $on_page = static function () use ($element) { - return $element->getLocation(); - }; - $auxiliary = $this->getID(); - - return new WebDriverCoordinates( - $on_screen, - $in_view_port, - $on_page, - $auxiliary - ); - } - - /** - * Get the size of element. - * - * @return WebDriverDimension The dimension of the element. - */ - public function getSize() - { - $size = $this->executor->execute( - DriverCommand::GET_ELEMENT_SIZE, - [':id' => $this->id] - ); - - return new WebDriverDimension($size['width'], $size['height']); - } - - /** - * Get the (lowercase) tag name of this element. - * - * @return string The tag name. - */ - public function getTagName() - { - // Force tag name to be lowercase as expected by JsonWire protocol for Opera driver - // until this issue is not resolved : - // https://github.com/operasoftware/operadriver/issues/102 - // Remove it when fixed to be consistent with the protocol. - return mb_strtolower($this->executor->execute( - DriverCommand::GET_ELEMENT_TAG_NAME, - [':id' => $this->id] - )); - } - - /** - * Get the visible (i.e. not hidden by CSS) innerText of this element, - * including sub-elements, without any leading or trailing whitespace. - * - * @return string The visible innerText of this element. - */ - public function getText() - { - return $this->executor->execute( - DriverCommand::GET_ELEMENT_TEXT, - [':id' => $this->id] - ); - } - - /** - * Is this element displayed or not? This method avoids the problem of having - * to parse an element's "style" attribute. - * - * @return bool - */ - public function isDisplayed() - { - return $this->executor->execute( - DriverCommand::IS_ELEMENT_DISPLAYED, - [':id' => $this->id] - ); - } - - /** - * Is the element currently enabled or not? This will generally return true - * for everything but disabled input elements. - * - * @return bool - */ - public function isEnabled() - { - return $this->executor->execute( - DriverCommand::IS_ELEMENT_ENABLED, - [':id' => $this->id] - ); - } - - /** - * Determine whether this element is selected or not. - * - * @return bool - */ - public function isSelected() - { - return $this->executor->execute( - DriverCommand::IS_ELEMENT_SELECTED, - [':id' => $this->id] - ); - } - - /** - * Simulate typing into an element, which may set its value. - * - * @param mixed $value The data to be typed. - * @return RemoteWebElement The current instance. - */ - public function sendKeys($value) - { - $local_file = $this->fileDetector->getLocalFile($value); - - $params = []; - if ($local_file === null) { - if ($this->isW3cCompliant) { - // Work around the Geckodriver NULL issue by splitting on NULL and calling sendKeys multiple times. - // See https://bugzilla.mozilla.org/show_bug.cgi?id=1494661. - $encodedValues = explode(WebDriverKeys::NULL, WebDriverKeys::encode($value, true)); - foreach ($encodedValues as $encodedValue) { - $params[] = [ - 'text' => $encodedValue, - ':id' => $this->id, - ]; - } - } else { - $params[] = [ - 'value' => WebDriverKeys::encode($value), - ':id' => $this->id, - ]; - } - } else { - if ($this->isW3cCompliant) { - try { - // Attempt to upload the file to the remote browser. - // This is so far non-W3C compliant method, so it may fail - if so, we just ignore the exception. - // @see https://github.com/w3c/webdriver/issues/1355 - $fileName = $this->upload($local_file); - } catch (WebDriverException $e) { - $fileName = $local_file; - } - - $params[] = [ - 'text' => $fileName, - ':id' => $this->id, - ]; - } else { - $params[] = [ - 'value' => WebDriverKeys::encode($this->upload($local_file)), - ':id' => $this->id, - ]; - } - } - - foreach ($params as $param) { - $this->executor->execute(DriverCommand::SEND_KEYS_TO_ELEMENT, $param); - } - - return $this; - } - - /** - * Set the fileDetector in order to let the RemoteWebElement to know that you are going to upload a file. - * - * Basically, if you want WebDriver trying to send a file, set the fileDetector - * to be LocalFileDetector. Otherwise, keep it UselessFileDetector. - * - * eg. `$element->setFileDetector(new LocalFileDetector);` - * - * @param FileDetector $detector - * @return RemoteWebElement - * @see FileDetector - * @see LocalFileDetector - * @see UselessFileDetector - */ - public function setFileDetector(FileDetector $detector) - { - $this->fileDetector = $detector; - - return $this; - } - - /** - * If this current element is a form, or an element within a form, then this will be submitted to the remote server. - * - * @return RemoteWebElement The current instance. - */ - public function submit() - { - if ($this->isW3cCompliant) { - // Submit method cannot be called directly in case an input of this form is named "submit". - // We use this polyfill to trigger 'submit' event using form.dispatchEvent(). - $submitPolyfill = $script = <<executor->execute(DriverCommand::EXECUTE_SCRIPT, [ - 'script' => $submitPolyfill, - 'args' => [[JsonWireCompat::WEB_DRIVER_ELEMENT_IDENTIFIER => $this->id]], - ]); - - return $this; - } - - $this->executor->execute( - DriverCommand::SUBMIT_ELEMENT, - [':id' => $this->id] - ); - - return $this; - } - - /** - * Get the opaque ID of the element. - * - * @return string The opaque ID. - */ - public function getID() - { - return $this->id; - } - - /** - * Take a screenshot of a specific element. - * - * @param string $save_as The path of the screenshot to be saved. - * @return string The screenshot in PNG format. - */ - public function takeElementScreenshot($save_as = null) - { - $screenshot = base64_decode( - $this->executor->execute( - DriverCommand::TAKE_ELEMENT_SCREENSHOT, - [':id' => $this->id] - ), - true - ); - - if ($save_as !== null) { - $directoryPath = dirname($save_as); - if (!file_exists($directoryPath)) { - mkdir($directoryPath, 0777, true); - } - - file_put_contents($save_as, $screenshot); - } - - return $screenshot; - } - - /** - * Test if two elements IDs refer to the same DOM element. - * - * @param WebDriverElement $other - * @return bool - */ - public function equals(WebDriverElement $other) - { - if ($this->isW3cCompliant) { - return $this->getID() === $other->getID(); - } - - return $this->executor->execute(DriverCommand::ELEMENT_EQUALS, [ - ':id' => $this->id, - ':other' => $other->getID(), - ]); - } - - /** - * Attempt to click on a child level element. - * - * This provides a workaround for geckodriver bug 653 whereby a link whose first element is a block-level element - * throws an ElementNotInteractableException could not scroll into view exception. - * - * The workaround provided here attempts to click on a child node of the element. - * In case the first child is hidden, other elements are processed until we run out of elements. - * - * @param ElementNotInteractableException $originalException The exception to throw if unable to click on any child - * @see https://github.com/mozilla/geckodriver/issues/653 - * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1374283 - */ - protected function clickChildElement(ElementNotInteractableException $originalException) - { - $children = $this->findElements(WebDriverBy::xpath('./*')); - foreach ($children as $child) { - try { - // Note: This does not use $child->click() as this would cause recursion into all children. - // Where the element is hidden, all children will also be hidden. - $this->executor->execute( - DriverCommand::CLICK_ELEMENT, - [':id' => $child->id] - ); - - return; - } catch (ElementNotInteractableException $e) { - // Ignore the ElementNotInteractableException exception on this node. Try the next child instead. - } - } - - throw $originalException; - } - - /** - * Return the WebDriverElement with $id - * - * @param string $id - * - * @return static - */ - protected function newElement($id) - { - return new static($this->executor, $id, $this->isW3cCompliant); - } - - /** - * Upload a local file to the server - * - * @param string $local_file - * - * @throws WebDriverException - * @return string The remote path of the file. - */ - protected function upload($local_file) - { - if (!is_file($local_file)) { - throw new WebDriverException('You may only upload files: ' . $local_file); - } - - $temp_zip_path = $this->createTemporaryZipArchive($local_file); - - $remote_path = $this->executor->execute( - DriverCommand::UPLOAD_FILE, - ['file' => base64_encode(file_get_contents($temp_zip_path))] - ); - - unlink($temp_zip_path); - - return $remote_path; - } - - /** - * @param string $fileToZip - * @return string - */ - protected function createTemporaryZipArchive($fileToZip) - { - // Create a temporary file in the system temp directory. - // Intentionally do not use `tempnam()`, as it creates empty file which zip extension may not handle. - $tempZipPath = sys_get_temp_dir() . '/' . uniqid('WebDriverZip', false); - - $zip = new ZipArchive(); - if (($errorCode = $zip->open($tempZipPath, ZipArchive::CREATE)) !== true) { - throw new WebDriverException(sprintf('Error creating zip archive: %s', $errorCode)); - } - - $info = pathinfo($fileToZip); - $file_name = $info['basename']; - $zip->addFile($fileToZip, $file_name); - $zip->close(); - - return $tempZipPath; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverCommandExecutor.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverCommandExecutor.php deleted file mode 100644 index d16ec943d4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverCommandExecutor.php +++ /dev/null @@ -1,55 +0,0 @@ -getURL()); - $this->service = $service; - } - - /** - * @param WebDriverCommand $command - * - * @throws \Exception - * @throws WebDriverException - * @return WebDriverResponse - */ - public function execute(WebDriverCommand $command) - { - if ($command->getName() === DriverCommand::NEW_SESSION) { - $this->service->start(); - } - - try { - $value = parent::execute($command); - if ($command->getName() === DriverCommand::QUIT) { - $this->service->stop(); - } - - return $value; - } catch (\Exception $e) { - if (!$this->service->isRunning()) { - throw new DriverServerDiedException($e); - } - throw $e; - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverService.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverService.php deleted file mode 100644 index 237ca46b9d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/Service/DriverService.php +++ /dev/null @@ -1,209 +0,0 @@ -setExecutable($executable); - $this->url = sprintf('http://localhost:%d', $port); - $this->args = $args; - $this->environment = $environment ?: $_ENV; - } - - /** - * @return string - */ - public function getURL() - { - return $this->url; - } - - /** - * @return DriverService - */ - public function start() - { - if ($this->process !== null) { - return $this; - } - - $this->process = $this->createProcess(); - $this->process->start(); - - $this->checkWasStarted($this->process); - - $checker = new URLChecker(); - $checker->waitUntilAvailable(20 * 1000, $this->url . '/status'); - - return $this; - } - - /** - * @return DriverService - */ - public function stop() - { - if ($this->process === null) { - return $this; - } - - $this->process->stop(); - $this->process = null; - - $checker = new URLChecker(); - $checker->waitUntilUnavailable(3 * 1000, $this->url . '/shutdown'); - - return $this; - } - - /** - * @return bool - */ - public function isRunning() - { - if ($this->process === null) { - return false; - } - - return $this->process->isRunning(); - } - - /** - * @deprecated Has no effect. Will be removed in next major version. Executable is now checked - * when calling setExecutable(). - * @param string $executable - * @return string - */ - protected static function checkExecutable($executable) - { - return $executable; - } - - /** - * @param string $executable - * @throws Exception - */ - protected function setExecutable($executable) - { - if ($this->isExecutable($executable)) { - $this->executable = $executable; - - return; - } - - throw new Exception( - sprintf( - '"%s" is not executable. Make sure the path is correct or use environment variable to specify' - . ' location of the executable.', - $executable - ) - ); - } - - /** - * @param Process $process - */ - protected function checkWasStarted($process) - { - usleep(10000); // wait 10ms, otherwise the asynchronous process failure may not yet be propagated - - if (!$process->isRunning()) { - throw new Exception( - sprintf( - 'Error starting driver executable "%s": %s', - $process->getCommandLine(), - $process->getErrorOutput() - ) - ); - } - } - - /** - * @return Process - */ - private function createProcess() - { - // BC: ProcessBuilder deprecated since Symfony 3.4 and removed in Symfony 4.0. - if (class_exists(ProcessBuilder::class) - && mb_strpos('@deprecated', (new \ReflectionClass(ProcessBuilder::class))->getDocComment()) === false - ) { - $processBuilder = (new ProcessBuilder()) - ->setPrefix($this->executable) - ->setArguments($this->args) - ->addEnvironmentVariables($this->environment); - - return $processBuilder->getProcess(); - } - // Safe to use since Symfony 3.3 - $commandLine = array_merge([$this->executable], $this->args); - - return new Process($commandLine, null, $this->environment); - } - - /** - * Check whether given file is executable directly or using system PATH - * - * @param string $filename - * @return bool - */ - private function isExecutable($filename) - { - if (is_executable($filename)) { - return true; - } - if ($filename !== basename($filename)) { // $filename is an absolute path, do no try to search it in PATH - return false; - } - - $paths = explode(PATH_SEPARATOR, getenv('PATH')); - foreach ($paths as $path) { - if (is_executable($path . DIRECTORY_SEPARATOR . $filename)) { - return true; - } - } - - return false; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/UselessFileDetector.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/UselessFileDetector.php deleted file mode 100644 index 6bce0e0043..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/UselessFileDetector.php +++ /dev/null @@ -1,11 +0,0 @@ -sessionID = $session_id; - $this->name = $name; - $this->parameters = $parameters; - } - - /** - * @return self - */ - public static function newSession(array $parameters) - { - // TODO: In 2.0 call empty constructor and assign properties directly. - return new self(null, DriverCommand::NEW_SESSION, $parameters); - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @return string|null Could be null for newSession command - */ - public function getSessionID() - { - return $this->sessionID; - } - - /** - * @return array - */ - public function getParameters() - { - return $this->parameters; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/WebDriverResponse.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/WebDriverResponse.php deleted file mode 100644 index 39b19bf098..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Remote/WebDriverResponse.php +++ /dev/null @@ -1,84 +0,0 @@ -sessionID = $session_id; - } - - /** - * @return null|int - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param int $status - * @return WebDriverResponse - */ - public function setStatus($status) - { - $this->status = $status; - - return $this; - } - - /** - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * @param mixed $value - * @return WebDriverResponse - */ - public function setValue($value) - { - $this->value = $value; - - return $this; - } - - /** - * @return null|string - */ - public function getSessionID() - { - return $this->sessionID; - } - - /** - * @param mixed $session_id - * @return WebDriverResponse - */ - public function setSessionID($session_id) - { - $this->sessionID = $session_id; - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriver.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriver.php deleted file mode 100644 index a4a74e3464..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriver.php +++ /dev/null @@ -1,406 +0,0 @@ -dispatcher = $dispatcher ?: new WebDriverDispatcher(); - if (!$this->dispatcher->getDefaultDriver()) { - $this->dispatcher->setDefaultDriver($this); - } - $this->driver = $driver; - } - - /** - * @return WebDriverDispatcher - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * @return WebDriver - */ - public function getWebDriver() - { - return $this->driver; - } - - /** - * @param mixed $url - * @throws WebDriverException - * @return $this - */ - public function get($url) - { - $this->dispatch('beforeNavigateTo', $url, $this); - - try { - $this->driver->get($url); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - $this->dispatch('afterNavigateTo', $url, $this); - - return $this; - } - - /** - * @param WebDriverBy $by - * @throws WebDriverException - * @return array - */ - public function findElements(WebDriverBy $by) - { - $this->dispatch('beforeFindBy', $by, null, $this); - $elements = []; - - try { - foreach ($this->driver->findElements($by) as $element) { - $elements[] = $this->newElement($element); - } - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - - $this->dispatch('afterFindBy', $by, null, $this); - - return $elements; - } - - /** - * @param WebDriverBy $by - * @throws WebDriverException - * @return EventFiringWebElement - */ - public function findElement(WebDriverBy $by) - { - $this->dispatch('beforeFindBy', $by, null, $this); - - try { - $element = $this->newElement($this->driver->findElement($by)); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - - $this->dispatch('afterFindBy', $by, null, $this); - - return $element; - } - - /** - * @param string $script - * @param array $arguments - * @throws WebDriverException - * @return mixed - */ - public function executeScript($script, array $arguments = []) - { - if (!$this->driver instanceof JavaScriptExecutor) { - throw new UnsupportedOperationException( - 'driver does not implement JavaScriptExecutor' - ); - } - - $this->dispatch('beforeScript', $script, $this); - - try { - $result = $this->driver->executeScript($script, $arguments); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - - $this->dispatch('afterScript', $script, $this); - - return $result; - } - - /** - * @param string $script - * @param array $arguments - * @throws WebDriverException - * @return mixed - */ - public function executeAsyncScript($script, array $arguments = []) - { - if (!$this->driver instanceof JavaScriptExecutor) { - throw new UnsupportedOperationException( - 'driver does not implement JavaScriptExecutor' - ); - } - - $this->dispatch('beforeScript', $script, $this); - - try { - $result = $this->driver->executeAsyncScript($script, $arguments); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - $this->dispatch('afterScript', $script, $this); - - return $result; - } - - /** - * @throws WebDriverException - * @return $this - */ - public function close() - { - try { - $this->driver->close(); - - return $this; - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getCurrentURL() - { - try { - return $this->driver->getCurrentURL(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getPageSource() - { - try { - return $this->driver->getPageSource(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getTitle() - { - try { - return $this->driver->getTitle(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getWindowHandle() - { - try { - return $this->driver->getWindowHandle(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return array - */ - public function getWindowHandles() - { - try { - return $this->driver->getWindowHandles(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - */ - public function quit() - { - try { - $this->driver->quit(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param null|string $save_as - * @throws WebDriverException - * @return string - */ - public function takeScreenshot($save_as = null) - { - try { - return $this->driver->takeScreenshot($save_as); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param int $timeout_in_second - * @param int $interval_in_millisecond - * @throws WebDriverException - * @return WebDriverWait - */ - public function wait($timeout_in_second = 30, $interval_in_millisecond = 250) - { - try { - return $this->driver->wait($timeout_in_second, $interval_in_millisecond); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverOptions - */ - public function manage() - { - try { - return $this->driver->manage(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return EventFiringWebDriverNavigation - */ - public function navigate() - { - try { - return new EventFiringWebDriverNavigation( - $this->driver->navigate(), - $this->getDispatcher() - ); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverTargetLocator - */ - public function switchTo() - { - try { - return $this->driver->switchTo(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverTouchScreen - */ - public function getTouch() - { - try { - return $this->driver->getTouch(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - public function execute($name, $params) - { - try { - return $this->driver->execute($name, $params); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param WebDriverElement $element - * @return EventFiringWebElement - */ - protected function newElement(WebDriverElement $element) - { - return new EventFiringWebElement($element, $this->getDispatcher()); - } - - /** - * @param mixed $method - * @param mixed ...$arguments - */ - protected function dispatch($method, ...$arguments) - { - if (!$this->dispatcher) { - return; - } - - $this->dispatcher->dispatch($method, $arguments); - } - - /** - * @param WebDriverException $exception - */ - protected function dispatchOnException(WebDriverException $exception) - { - $this->dispatch('onException', $exception, $this); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriverNavigation.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriverNavigation.php deleted file mode 100644 index bcafa58c15..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebDriverNavigation.php +++ /dev/null @@ -1,143 +0,0 @@ -navigator = $navigator; - $this->dispatcher = $dispatcher; - } - - /** - * @return WebDriverDispatcher - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * @return WebDriverNavigationInterface - */ - public function getNavigator() - { - return $this->navigator; - } - - public function back() - { - $this->dispatch( - 'beforeNavigateBack', - $this->getDispatcher()->getDefaultDriver() - ); - - try { - $this->navigator->back(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - } - $this->dispatch( - 'afterNavigateBack', - $this->getDispatcher()->getDefaultDriver() - ); - - return $this; - } - - public function forward() - { - $this->dispatch( - 'beforeNavigateForward', - $this->getDispatcher()->getDefaultDriver() - ); - - try { - $this->navigator->forward(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - } - $this->dispatch( - 'afterNavigateForward', - $this->getDispatcher()->getDefaultDriver() - ); - - return $this; - } - - public function refresh() - { - try { - $this->navigator->refresh(); - - return $this; - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - public function to($url) - { - $this->dispatch( - 'beforeNavigateTo', - $url, - $this->getDispatcher()->getDefaultDriver() - ); - - try { - $this->navigator->to($url); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - - $this->dispatch( - 'afterNavigateTo', - $url, - $this->getDispatcher()->getDefaultDriver() - ); - - return $this; - } - - /** - * @param mixed $method - * @param mixed ...$arguments - */ - protected function dispatch($method, ...$arguments) - { - if (!$this->dispatcher) - { - return; - } - - $this->dispatcher->dispatch($method, $arguments); - } - - /** - * @param WebDriverException $exception - */ - protected function dispatchOnException(WebDriverException $exception) - { - $this->dispatch('onException', $exception); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebElement.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebElement.php deleted file mode 100644 index a2fe4bb973..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/Events/EventFiringWebElement.php +++ /dev/null @@ -1,404 +0,0 @@ -element = $element; - $this->dispatcher = $dispatcher; - } - - /** - * @return WebDriverDispatcher - */ - public function getDispatcher() - { - return $this->dispatcher; - } - - /** - * @return WebDriverElement - */ - public function getElement() - { - return $this->element; - } - - /** - * @param mixed $value - * @throws WebDriverException - * @return $this - */ - public function sendKeys($value) - { - $this->dispatch('beforeChangeValueOf', $this); - - try { - $this->element->sendKeys($value); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - $this->dispatch('afterChangeValueOf', $this); - - return $this; - } - - /** - * @throws WebDriverException - * @return $this - */ - public function click() - { - $this->dispatch('beforeClickOn', $this); - - try { - $this->element->click(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - $this->dispatch('afterClickOn', $this); - - return $this; - } - - /** - * @param WebDriverBy $by - * @throws WebDriverException - * @return EventFiringWebElement - */ - public function findElement(WebDriverBy $by) - { - $this->dispatch( - 'beforeFindBy', - $by, - $this, - $this->dispatcher->getDefaultDriver() - ); - - try { - $element = $this->newElement($this->element->findElement($by)); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - - $this->dispatch( - 'afterFindBy', - $by, - $this, - $this->dispatcher->getDefaultDriver() - ); - - return $element; - } - - /** - * @param WebDriverBy $by - * @throws WebDriverException - * @return array - */ - public function findElements(WebDriverBy $by) - { - $this->dispatch( - 'beforeFindBy', - $by, - $this, - $this->dispatcher->getDefaultDriver() - ); - - try { - $elements = []; - foreach ($this->element->findElements($by) as $element) { - $elements[] = $this->newElement($element); - } - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - $this->dispatch( - 'afterFindBy', - $by, - $this, - $this->dispatcher->getDefaultDriver() - ); - - return $elements; - } - - /** - * @throws WebDriverException - * @return $this - */ - public function clear() - { - try { - $this->element->clear(); - - return $this; - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param string $attribute_name - * @throws WebDriverException - * @return string - */ - public function getAttribute($attribute_name) - { - try { - return $this->element->getAttribute($attribute_name); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param string $css_property_name - * @throws WebDriverException - * @return string - */ - public function getCSSValue($css_property_name) - { - try { - return $this->element->getCSSValue($css_property_name); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverPoint - */ - public function getLocation() - { - try { - return $this->element->getLocation(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverPoint - */ - public function getLocationOnScreenOnceScrolledIntoView() - { - try { - return $this->element->getLocationOnScreenOnceScrolledIntoView(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @return WebDriverCoordinates - */ - public function getCoordinates() - { - try { - return $this->element->getCoordinates(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return WebDriverDimension - */ - public function getSize() - { - try { - return $this->element->getSize(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getTagName() - { - try { - return $this->element->getTagName(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getText() - { - try { - return $this->element->getText(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return bool - */ - public function isDisplayed() - { - try { - return $this->element->isDisplayed(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return bool - */ - public function isEnabled() - { - try { - return $this->element->isEnabled(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return bool - */ - public function isSelected() - { - try { - return $this->element->isSelected(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return $this - */ - public function submit() - { - try { - $this->element->submit(); - - return $this; - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @throws WebDriverException - * @return string - */ - public function getID() - { - try { - return $this->element->getID(); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * Test if two element IDs refer to the same DOM element. - * - * @param WebDriverElement $other - * @return bool - */ - public function equals(WebDriverElement $other) - { - try { - return $this->element->equals($other); - } catch (WebDriverException $exception) { - $this->dispatchOnException($exception); - throw $exception; - } - } - - /** - * @param WebDriverException $exception - */ - protected function dispatchOnException(WebDriverException $exception) - { - $this->dispatch( - 'onException', - $exception, - $this->dispatcher->getDefaultDriver() - ); - } - - /** - * @param mixed $method - * @param mixed ...$arguments - */ - protected function dispatch($method, ...$arguments) - { - if (!$this->dispatcher) { - return; - } - - $this->dispatcher->dispatch($method, $arguments); - } - - /** - * @param WebDriverElement $element - * @return static - */ - protected function newElement(WebDriverElement $element) - { - return new static($element, $this->getDispatcher()); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/XPathEscaper.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/XPathEscaper.php deleted file mode 100644 index eb85081ca4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/Support/XPathEscaper.php +++ /dev/null @@ -1,32 +0,0 @@ - `concat('foo', "'" ,'"bar')` - * - * @param string $xpathToEscape The xpath to be converted. - * @return string The escaped string. - */ - public static function escapeQuotes($xpathToEscape) - { - // Single quotes not present => we can quote in them - if (mb_strpos($xpathToEscape, "'") === false) { - return sprintf("'%s'", $xpathToEscape); - } - - // Double quotes not present => we can quote in them - if (mb_strpos($xpathToEscape, '"') === false) { - return sprintf('"%s"', $xpathToEscape); - } - - // Both single and double quotes are present - return sprintf( - "concat('%s')", - str_replace("'", "', \"'\" ,'", $xpathToEscape) - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriver.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriver.php deleted file mode 100644 index 52120a7d72..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriver.php +++ /dev/null @@ -1,143 +0,0 @@ -wait(20, 1000)->until( - * WebDriverExpectedCondition::titleIs('WebDriver Page') - * ); - * - * @param int $timeout_in_second - * @param int $interval_in_millisecond - * @return WebDriverWait - */ - public function wait( - $timeout_in_second = 30, - $interval_in_millisecond = 250 - ); - - /** - * An abstraction for managing stuff you would do in a browser menu. For - * example, adding and deleting cookies. - * - * @return WebDriverOptions - */ - public function manage(); - - /** - * An abstraction allowing the driver to access the browser's history and to - * navigate to a given URL. - * - * @return WebDriverNavigationInterface - * @see WebDriverNavigation - */ - public function navigate(); - - /** - * Switch to a different window or frame. - * - * @return WebDriverTargetLocator - * @see WebDriverTargetLocator - */ - public function switchTo(); - - // TODO: Add in next major release (BC) - ///** - // * @return WebDriverTouchScreen - // */ - //public function getTouch(); - - /** - * @param string $name - * @param array $params - * @return mixed - */ - public function execute($name, $params); - - // TODO: Add in next major release (BC) - ///** - // * Execute custom commands on remote end. - // * For example vendor-specific commands or other commands not implemented by php-webdriver. - // * - // * @see https://github.com/php-webdriver/php-webdriver/wiki/Custom-commands - // * @param string $endpointUrl - // * @param string $method - // * @param array $params - // * @return mixed|null - // */ - //public function executeCustomCommand($endpointUrl, $method = 'GET', $params = []); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverAction.php deleted file mode 100644 index 3b3a784186..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverAction.php +++ /dev/null @@ -1,11 +0,0 @@ -executor = $executor; - } - - /** - * Accept alert - * - * @return WebDriverAlert The instance. - */ - public function accept() - { - $this->executor->execute(DriverCommand::ACCEPT_ALERT); - - return $this; - } - - /** - * Dismiss alert - * - * @return WebDriverAlert The instance. - */ - public function dismiss() - { - $this->executor->execute(DriverCommand::DISMISS_ALERT); - - return $this; - } - - /** - * Get alert text - * - * @return string - */ - public function getText() - { - return $this->executor->execute(DriverCommand::GET_ALERT_TEXT); - } - - /** - * Send keystrokes to javascript prompt() dialog - * - * @param string $value - * @return WebDriverAlert - */ - public function sendKeys($value) - { - $this->executor->execute( - DriverCommand::SET_ALERT_VALUE, - ['text' => $value] - ); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverBy.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverBy.php deleted file mode 100644 index 4bead6743a..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverBy.php +++ /dev/null @@ -1,134 +0,0 @@ -mechanism = $mechanism; - $this->value = $value; - } - - /** - * @return string - */ - public function getMechanism() - { - return $this->mechanism; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Locates elements whose class name contains the search value; compound class - * names are not permitted. - * - * @param string $class_name - * @return static - */ - public static function className($class_name) - { - return new static('class name', $class_name); - } - - /** - * Locates elements matching a CSS selector. - * - * @param string $css_selector - * @return static - */ - public static function cssSelector($css_selector) - { - return new static('css selector', $css_selector); - } - - /** - * Locates elements whose ID attribute matches the search value. - * - * @param string $id - * @return static - */ - public static function id($id) - { - return new static('id', $id); - } - - /** - * Locates elements whose NAME attribute matches the search value. - * - * @param string $name - * @return static - */ - public static function name($name) - { - return new static('name', $name); - } - - /** - * Locates anchor elements whose visible text matches the search value. - * - * @param string $link_text - * @return static - */ - public static function linkText($link_text) - { - return new static('link text', $link_text); - } - - /** - * Locates anchor elements whose visible text partially matches the search - * value. - * - * @param string $partial_link_text - * @return static - */ - public static function partialLinkText($partial_link_text) - { - return new static('partial link text', $partial_link_text); - } - - /** - * Locates elements whose tag name matches the search value. - * - * @param string $tag_name - * @return static - */ - public static function tagName($tag_name) - { - return new static('tag name', $tag_name); - } - - /** - * Locates elements matching an XPath expression. - * - * @param string $xpath - * @return static - */ - public static function xpath($xpath) - { - return new static('xpath', $xpath); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCapabilities.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCapabilities.php deleted file mode 100644 index 75cb99de26..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCapabilities.php +++ /dev/null @@ -1,46 +0,0 @@ -type = $element->getAttribute('type'); - if ($this->type !== 'checkbox') { - throw new WebDriverException('The input must be of type "checkbox".'); - } - } - - public function isMultiple() - { - return true; - } - - public function deselectAll() - { - foreach ($this->getRelatedElements() as $checkbox) { - $this->deselectOption($checkbox); - } - } - - public function deselectByIndex($index) - { - $this->byIndex($index, false); - } - - public function deselectByValue($value) - { - $this->byValue($value, false); - } - - public function deselectByVisibleText($text) - { - $this->byVisibleText($text, false, false); - } - - public function deselectByVisiblePartialText($text) - { - $this->byVisibleText($text, true, false); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCommandExecutor.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCommandExecutor.php deleted file mode 100644 index 4031c235d2..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverCommandExecutor.php +++ /dev/null @@ -1,19 +0,0 @@ -width = $width; - $this->height = $height; - } - - /** - * Get the height. - * - * @return int The height. - */ - public function getHeight() - { - return (int) $this->height; - } - - /** - * Get the width. - * - * @return int The width. - */ - public function getWidth() - { - return (int) $this->width; - } - - /** - * Check whether the given dimension is the same as the instance. - * - * @param WebDriverDimension $dimension The dimension to be compared with. - * @return bool Whether the height and the width are the same as the instance. - */ - public function equals(self $dimension) - { - return $this->height === $dimension->getHeight() && $this->width === $dimension->getWidth(); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverDispatcher.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverDispatcher.php deleted file mode 100644 index 8512147197..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverDispatcher.php +++ /dev/null @@ -1,78 +0,0 @@ -driver = $driver; - - return $this; - } - - /** - * @return null|EventFiringWebDriver - */ - public function getDefaultDriver() - { - return $this->driver; - } - - /** - * @param WebDriverEventListener $listener - * @return $this - */ - public function register(WebDriverEventListener $listener) - { - $this->listeners[] = $listener; - - return $this; - } - - /** - * @param WebDriverEventListener $listener - * @return $this - */ - public function unregister(WebDriverEventListener $listener) - { - $key = array_search($listener, $this->listeners, true); - if ($key !== false) { - unset($this->listeners[$key]); - } - - return $this; - } - - /** - * @param mixed $method - * @param mixed $arguments - * @return $this - */ - public function dispatch($method, $arguments) - { - foreach ($this->listeners as $listener) { - call_user_func_array([$listener, $method], $arguments); - } - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverElement.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverElement.php deleted file mode 100644 index 3409dde18c..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverElement.php +++ /dev/null @@ -1,144 +0,0 @@ -apply = $apply; - } - - /** - * @return callable A callable function to be executed by WebDriverWait - */ - public function getApply() - { - return $this->apply; - } - - /** - * An expectation for checking the title of a page. - * - * @param string $title The expected title, which must be an exact match. - * @return static Condition returns whether current page title equals given string. - */ - public static function titleIs($title) - { - return new static( - function (WebDriver $driver) use ($title) { - return $title === $driver->getTitle(); - } - ); - } - - /** - * An expectation for checking substring of a page Title. - * - * @param string $title The expected substring of Title. - * @return static Condition returns whether current page title contains given string. - */ - public static function titleContains($title) - { - return new static( - function (WebDriver $driver) use ($title) { - return mb_strpos($driver->getTitle(), $title) !== false; - } - ); - } - - /** - * An expectation for checking current page title matches the given regular expression. - * - * @param string $titleRegexp The regular expression to test against. - * @return static Condition returns whether current page title matches the regular expression. - */ - public static function titleMatches($titleRegexp) - { - return new static( - function (WebDriver $driver) use ($titleRegexp) { - return (bool) preg_match($titleRegexp, $driver->getTitle()); - } - ); - } - - /** - * An expectation for checking the URL of a page. - * - * @param string $url The expected URL, which must be an exact match. - * @return static Condition returns whether current URL equals given one. - */ - public static function urlIs($url) - { - return new static( - function (WebDriver $driver) use ($url) { - return $url === $driver->getCurrentURL(); - } - ); - } - - /** - * An expectation for checking substring of the URL of a page. - * - * @param string $url The expected substring of the URL - * @return static Condition returns whether current URL contains given string. - */ - public static function urlContains($url) - { - return new static( - function (WebDriver $driver) use ($url) { - return mb_strpos($driver->getCurrentURL(), $url) !== false; - } - ); - } - - /** - * An expectation for checking current page URL matches the given regular expression. - * - * @param string $urlRegexp The regular expression to test against. - * @return static Condition returns whether current URL matches the regular expression. - */ - public static function urlMatches($urlRegexp) - { - return new static( - function (WebDriver $driver) use ($urlRegexp) { - return (bool) preg_match($urlRegexp, $driver->getCurrentURL()); - } - ); - } - - /** - * An expectation for checking that an element is present on the DOM of a page. - * This does not necessarily mean that the element is visible. - * - * @param WebDriverBy $by The locator used to find the element. - * @return static Condition returns the WebDriverElement which is located. - */ - public static function presenceOfElementLocated(WebDriverBy $by) - { - return new static( - function (WebDriver $driver) use ($by) { - try { - return $driver->findElement($by); - } catch (NoSuchElementException $e) { - return false; - } - } - ); - } - - /** - * An expectation for checking that there is at least one element present on a web page. - * - * @param WebDriverBy $by The locator used to find the element. - * @return static Condition return an array of WebDriverElement once they are located. - */ - public static function presenceOfAllElementsLocatedBy(WebDriverBy $by) - { - return new static( - function (WebDriver $driver) use ($by) { - $elements = $driver->findElements($by); - - return count($elements) > 0 ? $elements : null; - } - ); - } - - /** - * An expectation for checking that an element is present on the DOM of a page and visible. - * Visibility means that the element is not only displayed but also has a height and width that is greater than 0. - * - * @param WebDriverBy $by The locator used to find the element. - * @return static Condition returns the WebDriverElement which is located and visible. - */ - public static function visibilityOfElementLocated(WebDriverBy $by) - { - return new static( - function (WebDriver $driver) use ($by) { - try { - $element = $driver->findElement($by); - - return $element->isDisplayed() ? $element : null; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * An expectation for checking than at least one element in an array of elements is present on the - * DOM of a page and visible. - * Visibility means that the element is not only displayed but also has a height and width that is greater than 0. - * - * @param WebDriverBy $by The located used to find the element. - * @return static Condition returns the array of WebDriverElement that are located and visible. - */ - public static function visibilityOfAnyElementLocated(WebDriverBy $by) - { - return new static( - function (WebDriver $driver) use ($by) { - $elements = $driver->findElements($by); - $visibleElements = []; - - foreach ($elements as $element) { - try { - if ($element->isDisplayed()) { - $visibleElements[] = $element; - } - } catch (StaleElementReferenceException $e) { - } - } - - return count($visibleElements) > 0 ? $visibleElements : null; - } - ); - } - - /** - * An expectation for checking that an element, known to be present on the DOM of a page, is visible. - * Visibility means that the element is not only displayed but also has a height and width that is greater than 0. - * - * @param WebDriverElement $element The element to be checked. - * @return static Condition returns the same WebDriverElement once it is visible. - */ - public static function visibilityOf(WebDriverElement $element) - { - return new static( - function () use ($element) { - return $element->isDisplayed() ? $element : null; - } - ); - } - - /** - * An expectation for checking if the given text is present in the specified element. - * To check exact text match use elementTextIs() condition. - * - * @codeCoverageIgnore - * @deprecated Use WebDriverExpectedCondition::elementTextContains() instead - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The text to be presented in the element. - * @return static Condition returns whether the text is present in the element. - */ - public static function textToBePresentInElement(WebDriverBy $by, $text) - { - return self::elementTextContains($by, $text); - } - - /** - * An expectation for checking if the given text is present in the specified element. - * To check exact text match use elementTextIs() condition. - * - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The text to be presented in the element. - * @return static Condition returns whether the partial text is present in the element. - */ - public static function elementTextContains(WebDriverBy $by, $text) - { - return new static( - function (WebDriver $driver) use ($by, $text) { - try { - $element_text = $driver->findElement($by)->getText(); - - return mb_strpos($element_text, $text) !== false; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * An expectation for checking if the given text exactly equals the text in specified element. - * To check only partial substring of the text use elementTextContains() condition. - * - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The expected text of the element. - * @return static Condition returns whether the element has text value equal to given one. - */ - public static function elementTextIs(WebDriverBy $by, $text) - { - return new static( - function (WebDriver $driver) use ($by, $text) { - try { - return $driver->findElement($by)->getText() == $text; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * An expectation for checking if the given regular expression matches the text in specified element. - * - * @param WebDriverBy $by The locator used to find the element. - * @param string $regexp The regular expression to test against. - * @return static Condition returns whether the element has text value equal to given one. - */ - public static function elementTextMatches(WebDriverBy $by, $regexp) - { - return new static( - function (WebDriver $driver) use ($by, $regexp) { - try { - return (bool) preg_match($regexp, $driver->findElement($by)->getText()); - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * An expectation for checking if the given text is present in the specified elements value attribute. - * - * @codeCoverageIgnore - * @deprecated Use WebDriverExpectedCondition::elementValueContains() instead - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The text to be presented in the element value. - * @return static Condition returns whether the text is present in value attribute. - */ - public static function textToBePresentInElementValue(WebDriverBy $by, $text) - { - return self::elementValueContains($by, $text); - } - - /** - * An expectation for checking if the given text is present in the specified elements value attribute. - * - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The text to be presented in the element value. - * @return static Condition returns whether the text is present in value attribute. - */ - public static function elementValueContains(WebDriverBy $by, $text) - { - return new static( - function (WebDriver $driver) use ($by, $text) { - try { - $element_text = $driver->findElement($by)->getAttribute('value'); - - return mb_strpos($element_text, $text) !== false; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * Expectation for checking if iFrame exists. If iFrame exists switches driver's focus to the iFrame. - * - * @param string $frame_locator The locator used to find the iFrame - * expected to be either the id or name value of the i/frame - * @return static Condition returns object focused on new frame when frame is found, false otherwise. - */ - public static function frameToBeAvailableAndSwitchToIt($frame_locator) - { - return new static( - function (WebDriver $driver) use ($frame_locator) { - try { - return $driver->switchTo()->frame($frame_locator); - } catch (NoSuchFrameException $e) { - return false; - } - } - ); - } - - /** - * An expectation for checking that an element is either invisible or not present on the DOM. - * - * @param WebDriverBy $by The locator used to find the element. - * @return static Condition returns whether no visible element located. - */ - public static function invisibilityOfElementLocated(WebDriverBy $by) - { - return new static( - function (WebDriver $driver) use ($by) { - try { - return !$driver->findElement($by)->isDisplayed(); - } catch (NoSuchElementException $e) { - return true; - } catch (StaleElementReferenceException $e) { - return true; - } - } - ); - } - - /** - * An expectation for checking that an element with text is either invisible or not present on the DOM. - * - * @param WebDriverBy $by The locator used to find the element. - * @param string $text The text of the element. - * @return static Condition returns whether the text is found in the element located. - */ - public static function invisibilityOfElementWithText(WebDriverBy $by, $text) - { - return new static( - function (WebDriver $driver) use ($by, $text) { - try { - return !($driver->findElement($by)->getText() === $text); - } catch (NoSuchElementException $e) { - return true; - } catch (StaleElementReferenceException $e) { - return true; - } - } - ); - } - - /** - * An expectation for checking an element is visible and enabled such that you can click it. - * - * @param WebDriverBy $by The locator used to find the element - * @return static Condition return the WebDriverElement once it is located, visible and clickable. - */ - public static function elementToBeClickable(WebDriverBy $by) - { - $visibility_of_element_located = self::visibilityOfElementLocated($by); - - return new static( - function (WebDriver $driver) use ($visibility_of_element_located) { - $element = call_user_func( - $visibility_of_element_located->getApply(), - $driver - ); - - try { - if ($element !== null && $element->isEnabled()) { - return $element; - } - - return null; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * Wait until an element is no longer attached to the DOM. - * - * @param WebDriverElement $element The element to wait for. - * @return static Condition returns whether the element is still attached to the DOM. - */ - public static function stalenessOf(WebDriverElement $element) - { - return new static( - function () use ($element) { - try { - $element->isEnabled(); - - return false; - } catch (StaleElementReferenceException $e) { - return true; - } - } - ); - } - - /** - * Wrapper for a condition, which allows for elements to update by redrawing. - * - * This works around the problem of conditions which have two parts: find an element and then check for some - * condition on it. For these conditions it is possible that an element is located and then subsequently it is - * redrawn on the client. When this happens a StaleElementReferenceException is thrown when the second part of - * the condition is checked. - * - * @param WebDriverExpectedCondition $condition The condition wrapped. - * @return static Condition returns the return value of the getApply() of the given condition. - */ - public static function refreshed(self $condition) - { - return new static( - function (WebDriver $driver) use ($condition) { - try { - return call_user_func($condition->getApply(), $driver); - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - /** - * An expectation for checking if the given element is selected. - * - * @param mixed $element_or_by Either the element or the locator. - * @return static Condition returns whether the element is selected. - */ - public static function elementToBeSelected($element_or_by) - { - return self::elementSelectionStateToBe( - $element_or_by, - true - ); - } - - /** - * An expectation for checking if the given element is selected. - * - * @param mixed $element_or_by Either the element or the locator. - * @param bool $selected The required state. - * @return static Condition returns whether the element is selected. - */ - public static function elementSelectionStateToBe($element_or_by, $selected) - { - if ($element_or_by instanceof WebDriverElement) { - return new static( - function () use ($element_or_by, $selected) { - return $element_or_by->isSelected() === $selected; - } - ); - } - - if ($element_or_by instanceof WebDriverBy) { - return new static( - function (WebDriver $driver) use ($element_or_by, $selected) { - try { - $element = $driver->findElement($element_or_by); - - return $element->isSelected() === $selected; - } catch (StaleElementReferenceException $e) { - return null; - } - } - ); - } - - throw new \InvalidArgumentException('Instance of either WebDriverElement or WebDriverBy must be given'); - } - - /** - * An expectation for whether an alert() box is present. - * - * @return static Condition returns WebDriverAlert if alert() is present, null otherwise. - */ - public static function alertIsPresent() - { - return new static( - function (WebDriver $driver) { - try { - // Unlike the Java code, we get a WebDriverAlert object regardless - // of whether there is an alert. Calling getText() will throw - // an exception if it is not really there. - $alert = $driver->switchTo()->alert(); - $alert->getText(); - - return $alert; - } catch (NoSuchAlertException $e) { - return null; - } - } - ); - } - - /** - * An expectation checking the number of opened windows. - * - * @param int $expectedNumberOfWindows - * @return static - */ - public static function numberOfWindowsToBe($expectedNumberOfWindows) - { - return new static( - function (WebDriver $driver) use ($expectedNumberOfWindows) { - return count($driver->getWindowHandles()) == $expectedNumberOfWindows; - } - ); - } - - /** - * An expectation with the logical opposite condition of the given condition. - * - * @param WebDriverExpectedCondition $condition The condition to be negated. - * @return mixed The negation of the result of the given condition. - */ - public static function not(self $condition) - { - return new static( - function (WebDriver $driver) use ($condition) { - $result = call_user_func($condition->getApply(), $driver); - - return !$result; - } - ); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverHasInputDevices.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverHasInputDevices.php deleted file mode 100644 index efe41ae42f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverHasInputDevices.php +++ /dev/null @@ -1,19 +0,0 @@ -executor = $executor; - } - - public function back() - { - $this->executor->execute(DriverCommand::GO_BACK); - - return $this; - } - - public function forward() - { - $this->executor->execute(DriverCommand::GO_FORWARD); - - return $this; - } - - public function refresh() - { - $this->executor->execute(DriverCommand::REFRESH); - - return $this; - } - - public function to($url) - { - $params = ['url' => (string) $url]; - $this->executor->execute(DriverCommand::GET, $params); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverNavigationInterface.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverNavigationInterface.php deleted file mode 100644 index 6fcd06e6a5..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverNavigationInterface.php +++ /dev/null @@ -1,43 +0,0 @@ -executor = $executor; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * Add a specific cookie. - * - * @see Cookie for description of possible cookie properties - * @param Cookie|array $cookie Cookie object. May be also created from array for compatibility reasons. - * @return WebDriverOptions The current instance. - */ - public function addCookie($cookie) - { - if (is_array($cookie)) { // @todo @deprecated remove in 2.0 - $cookie = Cookie::createFromArray($cookie); - } - if (!$cookie instanceof Cookie) { - throw new InvalidArgumentException('Cookie must be set from instance of Cookie class or from array.'); - } - - $this->executor->execute( - DriverCommand::ADD_COOKIE, - ['cookie' => $cookie->toArray()] - ); - - return $this; - } - - /** - * Delete all the cookies that are currently visible. - * - * @return WebDriverOptions The current instance. - */ - public function deleteAllCookies() - { - $this->executor->execute(DriverCommand::DELETE_ALL_COOKIES); - - return $this; - } - - /** - * Delete the cookie with the given name. - * - * @param string $name - * @return WebDriverOptions The current instance. - */ - public function deleteCookieNamed($name) - { - $this->executor->execute( - DriverCommand::DELETE_COOKIE, - [':name' => $name] - ); - - return $this; - } - - /** - * Get the cookie with a given name. - * - * @param string $name - * @throws NoSuchCookieException In W3C compliant mode if no cookie with the given name is present - * @return Cookie|null The cookie, or null in JsonWire mode if no cookie with the given name is present - */ - public function getCookieNamed($name) - { - if ($this->isW3cCompliant) { - $cookieArray = $this->executor->execute( - DriverCommand::GET_NAMED_COOKIE, - [':name' => $name] - ); - - if (!is_array($cookieArray)) { // Microsoft Edge returns null even in W3C mode => emulate proper behavior - throw new NoSuchCookieException('no such cookie'); - } - - return Cookie::createFromArray($cookieArray); - } - - $cookies = $this->getCookies(); - foreach ($cookies as $cookie) { - if ($cookie['name'] === $name) { - return $cookie; - } - } - - return null; - } - - /** - * Get all the cookies for the current domain. - * - * @return Cookie[] The array of cookies presented. - */ - public function getCookies() - { - $cookieArrays = $this->executor->execute(DriverCommand::GET_ALL_COOKIES); - if (!is_array($cookieArrays)) { // Microsoft Edge returns null if there are no cookies... - return []; - } - - $cookies = []; - foreach ($cookieArrays as $cookieArray) { - $cookies[] = Cookie::createFromArray($cookieArray); - } - - return $cookies; - } - - /** - * Return the interface for managing driver timeouts. - * - * @return WebDriverTimeouts - */ - public function timeouts() - { - return new WebDriverTimeouts($this->executor, $this->isW3cCompliant); - } - - /** - * An abstraction allowing the driver to manipulate the browser's window - * - * @return WebDriverWindow - * @see WebDriverWindow - */ - public function window() - { - return new WebDriverWindow($this->executor, $this->isW3cCompliant); - } - - /** - * Get the log for a given log type. Log buffer is reset after each request. - * - * @param string $log_type The log type. - * @return array The list of log entries. - * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type - */ - public function getLog($log_type) - { - return $this->executor->execute( - DriverCommand::GET_LOG, - ['type' => $log_type] - ); - } - - /** - * Get available log types. - * - * @return array The list of available log types. - * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type - */ - public function getAvailableLogTypes() - { - return $this->executor->execute(DriverCommand::GET_AVAILABLE_LOG_TYPES); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverPlatform.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverPlatform.php deleted file mode 100644 index d7194e05e4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverPlatform.php +++ /dev/null @@ -1,25 +0,0 @@ -x = $x; - $this->y = $y; - } - - /** - * Get the x-coordinate. - * - * @return int The x-coordinate of the point. - */ - public function getX() - { - return (int) $this->x; - } - - /** - * Get the y-coordinate. - * - * @return int The y-coordinate of the point. - */ - public function getY() - { - return (int) $this->y; - } - - /** - * Set the point to a new position. - * - * @param int $new_x - * @param int $new_y - * @return WebDriverPoint The same instance with updated coordinates. - */ - public function move($new_x, $new_y) - { - $this->x = $new_x; - $this->y = $new_y; - - return $this; - } - - /** - * Move the current by offsets. - * - * @param int $x_offset - * @param int $y_offset - * @return WebDriverPoint The same instance with updated coordinates. - */ - public function moveBy($x_offset, $y_offset) - { - $this->x += $x_offset; - $this->y += $y_offset; - - return $this; - } - - /** - * Check whether the given point is the same as the instance. - * - * @param WebDriverPoint $point The point to be compared with. - * @return bool Whether the x and y coordinates are the same as the instance. - */ - public function equals(self $point) - { - return $this->x === $point->getX() && - $this->y === $point->getY(); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverRadios.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverRadios.php deleted file mode 100644 index e1687983e3..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverRadios.php +++ /dev/null @@ -1,52 +0,0 @@ -type = $element->getAttribute('type'); - if ($this->type !== 'radio') { - throw new WebDriverException('The input must be of type "radio".'); - } - } - - public function isMultiple() - { - return false; - } - - public function deselectAll() - { - throw new UnsupportedOperationException('You cannot deselect radio buttons'); - } - - public function deselectByIndex($index) - { - throw new UnsupportedOperationException('You cannot deselect radio buttons'); - } - - public function deselectByValue($value) - { - throw new UnsupportedOperationException('You cannot deselect radio buttons'); - } - - public function deselectByVisibleText($text) - { - throw new UnsupportedOperationException('You cannot deselect radio buttons'); - } - - public function deselectByVisiblePartialText($text) - { - throw new UnsupportedOperationException('You cannot deselect radio buttons'); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSearchContext.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSearchContext.php deleted file mode 100644 index 8a723d8e77..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSearchContext.php +++ /dev/null @@ -1,31 +0,0 @@ -` tag, providing helper methods to select and deselect options. - */ -class WebDriverSelect implements WebDriverSelectInterface -{ - /** @var WebDriverElement */ - private $element; - /** @var bool */ - private $isMulti; - - public function __construct(WebDriverElement $element) - { - $tag_name = $element->getTagName(); - - if ($tag_name !== 'select') { - throw new UnexpectedTagNameException('select', $tag_name); - } - $this->element = $element; - $value = $element->getAttribute('multiple'); - $this->isMulti = $value === 'true'; - } - - public function isMultiple() - { - return $this->isMulti; - } - - public function getOptions() - { - return $this->element->findElements(WebDriverBy::tagName('option')); - } - - public function getAllSelectedOptions() - { - $selected_options = []; - foreach ($this->getOptions() as $option) { - if ($option->isSelected()) { - $selected_options[] = $option; - - if (!$this->isMultiple()) { - return $selected_options; - } - } - } - - return $selected_options; - } - - public function getFirstSelectedOption() - { - foreach ($this->getOptions() as $option) { - if ($option->isSelected()) { - return $option; - } - } - - throw new NoSuchElementException('No options are selected'); - } - - public function selectByIndex($index) - { - foreach ($this->getOptions() as $option) { - if ($option->getAttribute('index') === (string) $index) { - $this->selectOption($option); - - return; - } - } - - throw new NoSuchElementException(sprintf('Cannot locate option with index: %d', $index)); - } - - public function selectByValue($value) - { - $matched = false; - $xpath = './/option[@value = ' . XPathEscaper::escapeQuotes($value) . ']'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - - foreach ($options as $option) { - $this->selectOption($option); - if (!$this->isMultiple()) { - return; - } - $matched = true; - } - - if (!$matched) { - throw new NoSuchElementException( - sprintf('Cannot locate option with value: %s', $value) - ); - } - } - - public function selectByVisibleText($text) - { - $matched = false; - $xpath = './/option[normalize-space(.) = ' . XPathEscaper::escapeQuotes($text) . ']'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - - foreach ($options as $option) { - $this->selectOption($option); - if (!$this->isMultiple()) { - return; - } - $matched = true; - } - - // Since the mechanism of getting the text in xpath is not the same as - // webdriver, use the expensive getText() to check if nothing is matched. - if (!$matched) { - foreach ($this->getOptions() as $option) { - if ($option->getText() === $text) { - $this->selectOption($option); - if (!$this->isMultiple()) { - return; - } - $matched = true; - } - } - } - - if (!$matched) { - throw new NoSuchElementException( - sprintf('Cannot locate option with text: %s', $text) - ); - } - } - - public function selectByVisiblePartialText($text) - { - $matched = false; - $xpath = './/option[contains(normalize-space(.), ' . XPathEscaper::escapeQuotes($text) . ')]'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - - foreach ($options as $option) { - $this->selectOption($option); - if (!$this->isMultiple()) { - return; - } - $matched = true; - } - - if (!$matched) { - throw new NoSuchElementException( - sprintf('Cannot locate option with text: %s', $text) - ); - } - } - - public function deselectAll() - { - if (!$this->isMultiple()) { - throw new UnsupportedOperationException('You may only deselect all options of a multi-select'); - } - - foreach ($this->getOptions() as $option) { - $this->deselectOption($option); - } - } - - public function deselectByIndex($index) - { - if (!$this->isMultiple()) { - throw new UnsupportedOperationException('You may only deselect options of a multi-select'); - } - - foreach ($this->getOptions() as $option) { - if ($option->getAttribute('index') === (string) $index) { - $this->deselectOption($option); - - return; - } - } - } - - public function deselectByValue($value) - { - if (!$this->isMultiple()) { - throw new UnsupportedOperationException('You may only deselect options of a multi-select'); - } - - $xpath = './/option[@value = ' . XPathEscaper::escapeQuotes($value) . ']'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - foreach ($options as $option) { - $this->deselectOption($option); - } - } - - public function deselectByVisibleText($text) - { - if (!$this->isMultiple()) { - throw new UnsupportedOperationException('You may only deselect options of a multi-select'); - } - - $xpath = './/option[normalize-space(.) = ' . XPathEscaper::escapeQuotes($text) . ']'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - foreach ($options as $option) { - $this->deselectOption($option); - } - } - - public function deselectByVisiblePartialText($text) - { - if (!$this->isMultiple()) { - throw new UnsupportedOperationException('You may only deselect options of a multi-select'); - } - - $xpath = './/option[contains(normalize-space(.), ' . XPathEscaper::escapeQuotes($text) . ')]'; - $options = $this->element->findElements(WebDriverBy::xpath($xpath)); - foreach ($options as $option) { - $this->deselectOption($option); - } - } - - /** - * Mark option selected - * @param WebDriverElement $option - */ - protected function selectOption(WebDriverElement $option) - { - if (!$option->isSelected()) { - $option->click(); - } - } - - /** - * Mark option not selected - * @param WebDriverElement $option - */ - protected function deselectOption(WebDriverElement $option) - { - if ($option->isSelected()) { - $option->click(); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSelectInterface.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSelectInterface.php deleted file mode 100644 index 030a783e99..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverSelectInterface.php +++ /dev/null @@ -1,128 +0,0 @@ -Bar` - * - * @param string $value The value to match against. - * - * @throws NoSuchElementException - */ - public function selectByValue($value); - - /** - * Select all options that display text matching the argument. That is, when given "Bar" this would - * select an option like: - * - * `` - * - * @param string $text The visible text to match against. - * - * @throws NoSuchElementException - */ - public function selectByVisibleText($text); - - /** - * Select all options that display text partially matching the argument. That is, when given "Bar" this would - * select an option like: - * - * `` - * - * @param string $text The visible text to match against. - * - * @throws NoSuchElementException - */ - public function selectByVisiblePartialText($text); - - /** - * Deselect all options in multiple select tag. - * - * @throws UnsupportedOperationException If the SELECT does not support multiple selections - */ - public function deselectAll(); - - /** - * Deselect the option at the given index. - * - * @param int $index The index of the option. (0-based) - * @throws UnsupportedOperationException If the SELECT does not support multiple selections - */ - public function deselectByIndex($index); - - /** - * Deselect all options that have value attribute matching the argument. That is, when given "foo" this would - * deselect an option like: - * - * `` - * - * @param string $value The value to match against. - * @throws UnsupportedOperationException If the SELECT does not support multiple selections - */ - public function deselectByValue($value); - - /** - * Deselect all options that display text matching the argument. That is, when given "Bar" this would - * deselect an option like: - * - * `` - * - * @param string $text The visible text to match against. - * @throws UnsupportedOperationException If the SELECT does not support multiple selections - */ - public function deselectByVisibleText($text); - - /** - * Deselect all options that display text matching the argument. That is, when given "Bar" this would - * deselect an option like: - * - * `` - * - * @param string $text The visible text to match against. - * @throws UnsupportedOperationException If the SELECT does not support multiple selections - */ - public function deselectByVisiblePartialText($text); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverTargetLocator.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverTargetLocator.php deleted file mode 100644 index 08096bcabb..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverTargetLocator.php +++ /dev/null @@ -1,69 +0,0 @@ -executor = $executor; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * Specify the amount of time the driver should wait when searching for an element if it is not immediately present. - * - * @param int $seconds Wait time in second. - * @return WebDriverTimeouts The current instance. - */ - public function implicitlyWait($seconds) - { - if ($this->isW3cCompliant) { - $this->executor->execute( - DriverCommand::IMPLICITLY_WAIT, - ['implicit' => $seconds * 1000] - ); - - return $this; - } - - $this->executor->execute( - DriverCommand::IMPLICITLY_WAIT, - ['ms' => $seconds * 1000] - ); - - return $this; - } - - /** - * Set the amount of time to wait for an asynchronous script to finish execution before throwing an error. - * - * @param int $seconds Wait time in second. - * @return WebDriverTimeouts The current instance. - */ - public function setScriptTimeout($seconds) - { - if ($this->isW3cCompliant) { - $this->executor->execute( - DriverCommand::SET_SCRIPT_TIMEOUT, - ['script' => $seconds * 1000] - ); - - return $this; - } - - $this->executor->execute( - DriverCommand::SET_SCRIPT_TIMEOUT, - ['ms' => $seconds * 1000] - ); - - return $this; - } - - /** - * Set the amount of time to wait for a page load to complete before throwing an error. - * - * @param int $seconds Wait time in second. - * @return WebDriverTimeouts The current instance. - */ - public function pageLoadTimeout($seconds) - { - if ($this->isW3cCompliant) { - $this->executor->execute( - DriverCommand::SET_SCRIPT_TIMEOUT, - ['pageLoad' => $seconds * 1000] - ); - - return $this; - } - - $this->executor->execute(DriverCommand::SET_TIMEOUT, [ - 'type' => 'page load', - 'ms' => $seconds * 1000, - ]); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverUpAction.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverUpAction.php deleted file mode 100644 index 62d275dea8..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverUpAction.php +++ /dev/null @@ -1,29 +0,0 @@ -x = $x; - $this->y = $y; - parent::__construct($touch_screen); - } - - public function perform() - { - $this->touchScreen->up($this->x, $this->y); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWait.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWait.php deleted file mode 100644 index 5b2009b3ce..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWait.php +++ /dev/null @@ -1,73 +0,0 @@ -driver = $driver; - $this->timeout = isset($timeout_in_second) ? $timeout_in_second : 30; - $this->interval = $interval_in_millisecond ?: 250; - } - - /** - * Calls the function provided with the driver as an argument until the return value is not falsey. - * - * @param callable|WebDriverExpectedCondition $func_or_ec - * @param string $message - * - * @throws \Exception - * @throws NoSuchElementException - * @throws TimeoutException - * @return mixed The return value of $func_or_ec - */ - public function until($func_or_ec, $message = '') - { - $end = microtime(true) + $this->timeout; - $last_exception = null; - - while ($end > microtime(true)) { - try { - if ($func_or_ec instanceof WebDriverExpectedCondition) { - $ret_val = call_user_func($func_or_ec->getApply(), $this->driver); - } else { - $ret_val = call_user_func($func_or_ec, $this->driver); - } - if ($ret_val) { - return $ret_val; - } - } catch (NoSuchElementException $e) { - $last_exception = $e; - } - usleep($this->interval * 1000); - } - - if ($last_exception) { - throw $last_exception; - } - - throw new TimeoutException($message); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWindow.php b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWindow.php deleted file mode 100644 index 57754eb769..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/lib/WebDriverWindow.php +++ /dev/null @@ -1,191 +0,0 @@ -executor = $executor; - $this->isW3cCompliant = $isW3cCompliant; - } - - /** - * Get the position of the current window, relative to the upper left corner - * of the screen. - * - * @return WebDriverPoint The current window position. - */ - public function getPosition() - { - $position = $this->executor->execute( - DriverCommand::GET_WINDOW_POSITION, - [':windowHandle' => 'current'] - ); - - return new WebDriverPoint( - $position['x'], - $position['y'] - ); - } - - /** - * Get the size of the current window. This will return the outer window - * dimension, not just the view port. - * - * @return WebDriverDimension The current window size. - */ - public function getSize() - { - $size = $this->executor->execute( - DriverCommand::GET_WINDOW_SIZE, - [':windowHandle' => 'current'] - ); - - return new WebDriverDimension( - $size['width'], - $size['height'] - ); - } - - /** - * Minimizes the current window if it is not already minimized. - * - * @return WebDriverWindow The instance. - */ - public function minimize() - { - if (!$this->isW3cCompliant) { - throw new UnsupportedOperationException('Minimize window is only supported in W3C mode'); - } - - $this->executor->execute(DriverCommand::MINIMIZE_WINDOW, []); - - return $this; - } - - /** - * Maximizes the current window if it is not already maximized - * - * @return WebDriverWindow The instance. - */ - public function maximize() - { - if ($this->isW3cCompliant) { - $this->executor->execute(DriverCommand::MAXIMIZE_WINDOW, []); - } else { - $this->executor->execute( - DriverCommand::MAXIMIZE_WINDOW, - [':windowHandle' => 'current'] - ); - } - - return $this; - } - - /** - * Makes the current window full screen. - * - * @return WebDriverWindow The instance. - */ - public function fullscreen() - { - if (!$this->isW3cCompliant) { - throw new UnsupportedOperationException('The Fullscreen window command is only supported in W3C mode'); - } - - $this->executor->execute(DriverCommand::FULLSCREEN_WINDOW, []); - - return $this; - } - - /** - * Set the size of the current window. This will change the outer window - * dimension, not just the view port. - * - * @param WebDriverDimension $size - * @return WebDriverWindow The instance. - */ - public function setSize(WebDriverDimension $size) - { - $params = [ - 'width' => $size->getWidth(), - 'height' => $size->getHeight(), - ':windowHandle' => 'current', - ]; - $this->executor->execute(DriverCommand::SET_WINDOW_SIZE, $params); - - return $this; - } - - /** - * Set the position of the current window. This is relative to the upper left - * corner of the screen. - * - * @param WebDriverPoint $position - * @return WebDriverWindow The instance. - */ - public function setPosition(WebDriverPoint $position) - { - $params = [ - 'x' => $position->getX(), - 'y' => $position->getY(), - ':windowHandle' => 'current', - ]; - $this->executor->execute(DriverCommand::SET_WINDOW_POSITION, $params); - - return $this; - } - - /** - * Get the current browser orientation. - * - * @return string Either LANDSCAPE|PORTRAIT - */ - public function getScreenOrientation() - { - return $this->executor->execute(DriverCommand::GET_SCREEN_ORIENTATION); - } - - /** - * Set the browser orientation. The orientation should either - * LANDSCAPE|PORTRAIT - * - * @param string $orientation - * @throws IndexOutOfBoundsException - * @return WebDriverWindow The instance. - */ - public function setScreenOrientation($orientation) - { - $orientation = mb_strtoupper($orientation); - if (!in_array($orientation, ['PORTRAIT', 'LANDSCAPE'], true)) { - throw new IndexOutOfBoundsException( - 'Orientation must be either PORTRAIT, or LANDSCAPE' - ); - } - - $this->executor->execute( - DriverCommand::SET_SCREEN_ORIENTATION, - ['orientation' => $orientation] - ); - - return $this; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/logs/.gitkeep b/test/lib/drivers/webdriver/phpwebdriver/php-webdriver/webdriver/logs/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/LICENSE b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd300..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Mbstring.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 693749f22b..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,873 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return \iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return \iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var); - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @\iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return \iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? \iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = \iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = \iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) \iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = \iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + \iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/README.md b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 478b40da25..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b081a..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e73b9..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index 1fedd1f7c8..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap80.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 82f5ac4d0f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/composer.json b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 9cd2e924e9..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/LICENSE b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d84f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Php80.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a959..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/PhpToken.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e691056..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/README.md b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/README.md deleted file mode 100644 index 3816c559d5..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/Attribute.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 7ea6d2772d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,22 +0,0 @@ -flags = $flags; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index 72f10812b3..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/composer.json b/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/composer.json deleted file mode 100644 index cd3e9b65f4..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/CHANGELOG.md b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/CHANGELOG.md deleted file mode 100644 index 31b9ee6a25..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/CHANGELOG.md +++ /dev/null @@ -1,116 +0,0 @@ -CHANGELOG -========= - -5.2.0 ------ - - * added `Process::setOptions()` to set `Process` specific options - * added option `create_new_console` to allow a subprocess to continue - to run after the main script exited, both on Linux and on Windows - -5.1.0 ------ - - * added `Process::getStartTime()` to retrieve the start time of the process as float - -5.0.0 ------ - - * removed `Process::inheritEnvironmentVariables()` - * removed `PhpProcess::setPhpBinary()` - * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell - * removed `Process::setCommandLine()` - -4.4.0 ------ - - * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. - * added `Process::getLastOutputTime()` method - -4.2.0 ------ - - * added the `Process::fromShellCommandline()` to run commands in a shell wrapper - * deprecated passing a command as string when creating a `Process` instance - * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods - * added the `Process::waitUntil()` method to wait for the process only for a - specific output, then continue the normal execution of your application - -4.1.0 ------ - - * added the `Process::isTtySupported()` method that allows to check for TTY support - * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary - * added the `ProcessSignaledException` class to properly catch signaled process errors - -4.0.0 ------ - - * environment variables will always be inherited - * added a second `array $env = []` argument to the `start()`, `run()`, - `mustRun()`, and `restart()` methods of the `Process` class - * added a second `array $env = []` argument to the `start()` method of the - `PhpProcess` class - * the `ProcessUtils::escapeArgument()` method has been removed - * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` - methods of the `Process` class have been removed - * support for passing `proc_open()` options has been removed - * removed the `ProcessBuilder` class, use the `Process` class instead - * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class - * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not - supported anymore - -3.4.0 ------ - - * deprecated the ProcessBuilder class - * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) - -3.3.0 ------ - - * added command line arrays in the `Process` class - * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods - * deprecated the `ProcessUtils::escapeArgument()` method - * deprecated not inheriting environment variables - * deprecated configuring `proc_open()` options - * deprecated configuring enhanced Windows compatibility - * deprecated configuring enhanced sigchild compatibility - -2.5.0 ------ - - * added support for PTY mode - * added the convenience method "mustRun" - * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() - * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() - * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types - -2.4.0 ------ - - * added the ability to define an idle timeout - -2.3.0 ------ - - * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows - * added Process::signal() - * added Process::getPid() - * added support for a TTY mode - -2.2.0 ------ - - * added ProcessBuilder::setArguments() to reset the arguments on a builder - * added a way to retrieve the standard and error output incrementally - * added Process:restart() - -2.1.0 ------ - - * added support for non-blocking processes (start(), wait(), isRunning(), stop()) - * enhanced Windows compatibility - * added Process::getExitCodeText() that returns a string representation for - the exit code returned by the process - * added ProcessBuilder diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ExceptionInterface.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ExceptionInterface.php deleted file mode 100644 index bd4a60403b..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * Marker Interface for the Process Component. - * - * @author Johannes M. Schmitt - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/InvalidArgumentException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/InvalidArgumentException.php deleted file mode 100644 index 926ee2118b..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * InvalidArgumentException for the Process Component. - * - * @author Romain Neutron - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/LogicException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/LogicException.php deleted file mode 100644 index be3d490dde..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * LogicException for the Process Component. - * - * @author Romain Neutron - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessFailedException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessFailedException.php deleted file mode 100644 index 328acfde5e..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessFailedException.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for failed processes. - * - * @author Johannes M. Schmitt - */ -class ProcessFailedException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - if ($process->isSuccessful()) { - throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); - } - - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", - $process->getCommandLine(), - $process->getExitCode(), - $process->getExitCodeText(), - $process->getWorkingDirectory() - ); - - if (!$process->isOutputDisabled()) { - $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", - $process->getOutput(), - $process->getErrorOutput() - ); - } - - parent::__construct($error); - - $this->process = $process; - } - - public function getProcess() - { - return $this->process; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessSignaledException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessSignaledException.php deleted file mode 100644 index d4d322756f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessSignaledException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process has been signaled. - * - * @author Sullivan Senechal - */ -final class ProcessSignaledException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - $this->process = $process; - - parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); - } - - public function getProcess(): Process - { - return $this->process; - } - - public function getSignal(): int - { - return $this->getProcess()->getTermSignal(); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessTimedOutException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessTimedOutException.php deleted file mode 100644 index 94391a4596..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/ProcessTimedOutException.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception that is thrown when a process times out. - * - * @author Johannes M. Schmitt - */ -class ProcessTimedOutException extends RuntimeException -{ - public const TYPE_GENERAL = 1; - public const TYPE_IDLE = 2; - - private $process; - private $timeoutType; - - public function __construct(Process $process, int $timeoutType) - { - $this->process = $process; - $this->timeoutType = $timeoutType; - - parent::__construct(sprintf( - 'The process "%s" exceeded the timeout of %s seconds.', - $process->getCommandLine(), - $this->getExceededTimeout() - )); - } - - public function getProcess() - { - return $this->process; - } - - public function isGeneralTimeout() - { - return self::TYPE_GENERAL === $this->timeoutType; - } - - public function isIdleTimeout() - { - return self::TYPE_IDLE === $this->timeoutType; - } - - public function getExceededTimeout() - { - switch ($this->timeoutType) { - case self::TYPE_GENERAL: - return $this->process->getTimeout(); - - case self::TYPE_IDLE: - return $this->process->getIdleTimeout(); - - default: - throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)); - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/RuntimeException.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/RuntimeException.php deleted file mode 100644 index adead2536b..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * RuntimeException for the Process Component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ExecutableFinder.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ExecutableFinder.php deleted file mode 100644 index 5914b4cd22..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ExecutableFinder.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * Generic executable finder. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class ExecutableFinder -{ - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; - - /** - * Replaces default suffixes of executable. - */ - public function setSuffixes(array $suffixes) - { - $this->suffixes = $suffixes; - } - - /** - * Adds new possible suffix to check for executable. - */ - public function addSuffix(string $suffix) - { - $this->suffixes[] = $suffix; - } - - /** - * Finds an executable by name. - * - * @param string $name The executable name (without the extension) - * @param string|null $default The default to return if no executable is found - * @param array $extraDirs Additional dirs to check into - * - * @return string|null - */ - public function find(string $name, string $default = null, array $extraDirs = []) - { - if (ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); - } - - $suffixes = ['']; - if ('\\' === \DIRECTORY_SEPARATOR) { - $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); - } - foreach ($suffixes as $suffix) { - foreach ($dirs as $dir) { - if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { - return $file; - } - } - } - - return $default; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/InputStream.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/InputStream.php deleted file mode 100644 index 240665f32a..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/InputStream.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * Provides a way to continuously write to the input of a Process until the InputStream is closed. - * - * @author Nicolas Grekas - * - * @implements \IteratorAggregate - */ -class InputStream implements \IteratorAggregate -{ - /** @var callable|null */ - private $onEmpty = null; - private $input = []; - private $open = true; - - /** - * Sets a callback that is called when the write buffer becomes empty. - */ - public function onEmpty(callable $onEmpty = null) - { - $this->onEmpty = $onEmpty; - } - - /** - * Appends an input to the write buffer. - * - * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, - * stream resource or \Traversable - */ - public function write($input) - { - if (null === $input) { - return; - } - if ($this->isClosed()) { - throw new RuntimeException(sprintf('"%s" is closed.', static::class)); - } - $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); - } - - /** - * Closes the write buffer. - */ - public function close() - { - $this->open = false; - } - - /** - * Tells whether the write buffer is closed or not. - */ - public function isClosed() - { - return !$this->open; - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - $this->open = true; - - while ($this->open || $this->input) { - if (!$this->input) { - yield ''; - continue; - } - $current = array_shift($this->input); - - if ($current instanceof \Iterator) { - yield from $current; - } else { - yield $current; - } - if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { - $this->write($onEmpty($this)); - } - } - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/LICENSE b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/LICENSE deleted file mode 100644 index 88bf75bb4d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpExecutableFinder.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpExecutableFinder.php deleted file mode 100644 index 998808b66f..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpExecutableFinder.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -/** - * An executable finder specifically designed for the PHP executable. - * - * @author Fabien Potencier - * @author Johannes M. Schmitt - */ -class PhpExecutableFinder -{ - private $executableFinder; - - public function __construct() - { - $this->executableFinder = new ExecutableFinder(); - } - - /** - * Finds The PHP executable. - * - * @return string|false - */ - public function find(bool $includeArgs = true) - { - if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } - } - - if (@is_dir($php)) { - return false; - } - - return $php; - } - - $args = $this->findArguments(); - $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; - - // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) { - return \PHP_BINARY.$args; - } - - if ($php = getenv('PHP_PATH')) { - if (!@is_executable($php) || @is_dir($php)) { - return false; - } - - return $php; - } - - if ($php = getenv('PHP_PEAR_PHP_BIN')) { - if (@is_executable($php) && !@is_dir($php)) { - return $php; - } - } - - if (@is_executable($php = \PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) { - return $php; - } - - $dirs = [\PHP_BINDIR]; - if ('\\' === \DIRECTORY_SEPARATOR) { - $dirs[] = 'C:\xampp\php\\'; - } - - return $this->executableFinder->find('php', false, $dirs); - } - - /** - * Finds the PHP executable arguments. - * - * @return array - */ - public function findArguments() - { - $arguments = []; - if ('phpdbg' === \PHP_SAPI) { - $arguments[] = '-qrr'; - } - - return $arguments; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpProcess.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpProcess.php deleted file mode 100644 index 2bc338e5e2..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/PhpProcess.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; - -/** - * PhpProcess runs a PHP script in an independent process. - * - * $p = new PhpProcess(''); - * $p->run(); - * print $p->getOutput()."\n"; - * - * @author Fabien Potencier - */ -class PhpProcess extends Process -{ - /** - * @param string $script The PHP script to run (as a string) - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array|null $php Path to the PHP binary to use with any additional arguments - */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) - { - if (null === $php) { - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(false); - $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); - } - if ('phpdbg' === \PHP_SAPI) { - $file = tempnam(sys_get_temp_dir(), 'dbg'); - file_put_contents($file, $script); - register_shutdown_function('unlink', $file); - $php[] = $file; - $script = null; - } - - parent::__construct($php, $cwd, $env, $script, $timeout); - } - - /** - * {@inheritdoc} - */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); - } - - /** - * {@inheritdoc} - */ - public function start(callable $callback = null, array $env = []) - { - if (null === $this->getCommandLine()) { - throw new RuntimeException('Unable to find the PHP executable.'); - } - - parent::start($callback, $env); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/AbstractPipes.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/AbstractPipes.php deleted file mode 100644 index 0105100562..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/AbstractPipes.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * @author Romain Neutron - * - * @internal - */ -abstract class AbstractPipes implements PipesInterface -{ - public $pipes = []; - - private $inputBuffer = ''; - private $input; - private $blocked = true; - private $lastError; - - /** - * @param resource|string|int|float|bool|\Iterator|null $input - */ - public function __construct($input) - { - if (\is_resource($input) || $input instanceof \Iterator) { - $this->input = $input; - } elseif (\is_string($input)) { - $this->inputBuffer = $input; - } else { - $this->inputBuffer = (string) $input; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - foreach ($this->pipes as $pipe) { - if (\is_resource($pipe)) { - fclose($pipe); - } - } - $this->pipes = []; - } - - /** - * Returns true if a system call has been interrupted. - */ - protected function hasSystemCallBeenInterrupted(): bool - { - $lastError = $this->lastError; - $this->lastError = null; - - // stream_select returns false when the `select` system call is interrupted by an incoming signal - return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); - } - - /** - * Unblocks streams. - */ - protected function unblock() - { - if (!$this->blocked) { - return; - } - - foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, 0); - } - if (\is_resource($this->input)) { - stream_set_blocking($this->input, 0); - } - - $this->blocked = false; - } - - /** - * Writes input to stdin. - * - * @throws InvalidArgumentException When an input iterator yields a non supported value - */ - protected function write(): ?array - { - if (!isset($this->pipes[0])) { - return null; - } - $input = $this->input; - - if ($input instanceof \Iterator) { - if (!$input->valid()) { - $input = null; - } elseif (\is_resource($input = $input->current())) { - stream_set_blocking($input, 0); - } elseif (!isset($this->inputBuffer[0])) { - if (!\is_string($input)) { - if (!is_scalar($input)) { - throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); - } - $input = (string) $input; - } - $this->inputBuffer = $input; - $this->input->next(); - $input = null; - } else { - $input = null; - } - } - - $r = $e = []; - $w = [$this->pipes[0]]; - - // let's have a look if something changed in streams - if (false === @stream_select($r, $w, $e, 0, 0)) { - return null; - } - - foreach ($w as $stdin) { - if (isset($this->inputBuffer[0])) { - $written = fwrite($stdin, $this->inputBuffer); - $this->inputBuffer = substr($this->inputBuffer, $written); - if (isset($this->inputBuffer[0])) { - return [$this->pipes[0]]; - } - } - - if ($input) { - while (true) { - $data = fread($input, self::CHUNK_SIZE); - if (!isset($data[0])) { - break; - } - $written = fwrite($stdin, $data); - $data = substr($data, $written); - if (isset($data[0])) { - $this->inputBuffer = $data; - - return [$this->pipes[0]]; - } - } - if (feof($input)) { - if ($this->input instanceof \Iterator) { - $this->input->next(); - } else { - $this->input = null; - } - } - } - } - - // no input to read on resource, buffer is empty - if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { - $this->input = null; - fclose($this->pipes[0]); - unset($this->pipes[0]); - } elseif (!$w) { - return [$this->pipes[0]]; - } - - return null; - } - - /** - * @internal - */ - public function handleError(int $type, string $msg) - { - $this->lastError = $msg; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/PipesInterface.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/PipesInterface.php deleted file mode 100644 index 50eb5c47e1..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/PipesInterface.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -/** - * PipesInterface manages descriptors and pipes for the use of proc_open. - * - * @author Romain Neutron - * - * @internal - */ -interface PipesInterface -{ - public const CHUNK_SIZE = 16384; - - /** - * Returns an array of descriptors for the use of proc_open. - */ - public function getDescriptors(): array; - - /** - * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. - * - * @return string[] - */ - public function getFiles(): array; - - /** - * Reads data in file handles and pipes. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close pipes if they've reached EOF - * - * @return string[] An array of read data indexed by their fd - */ - public function readAndWrite(bool $blocking, bool $close = false): array; - - /** - * Returns if the current state has open file handles or pipes. - */ - public function areOpen(): bool; - - /** - * Returns if pipes are able to read output. - */ - public function haveReadSupport(): bool; - - /** - * Closes file handles and pipes. - */ - public function close(); -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/UnixPipes.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/UnixPipes.php deleted file mode 100644 index 5a0e9d47fe..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/UnixPipes.php +++ /dev/null @@ -1,163 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Process; - -/** - * UnixPipes implementation uses unix pipes as handles. - * - * @author Romain Neutron - * - * @internal - */ -class UnixPipes extends AbstractPipes -{ - private $ttyMode; - private $ptyMode; - private $haveReadSupport; - - public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport) - { - $this->ttyMode = $ttyMode; - $this->ptyMode = $ptyMode; - $this->haveReadSupport = $haveReadSupport; - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - /** - * {@inheritdoc} - */ - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('/dev/null', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - if ($this->ttyMode) { - return [ - ['file', '/dev/tty', 'r'], - ['file', '/dev/tty', 'w'], - ['file', '/dev/tty', 'w'], - ]; - } - - if ($this->ptyMode && Process::isPtySupported()) { - return [ - ['pty'], - ['pty'], - ['pty'], - ]; - } - - return [ - ['pipe', 'r'], - ['pipe', 'w'], // stdout - ['pipe', 'w'], // stderr - ]; - } - - /** - * {@inheritdoc} - */ - public function getFiles(): array - { - return []; - } - - /** - * {@inheritdoc} - */ - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - - $read = $e = []; - $r = $this->pipes; - unset($r[0]); - - // let's have a look if something changed in streams - set_error_handler([$this, 'handleError']); - if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { - restore_error_handler(); - // if a system call has been interrupted, forget about it, let's try again - // otherwise, an error occurred, let's reset pipes - if (!$this->hasSystemCallBeenInterrupted()) { - $this->pipes = []; - } - - return $read; - } - restore_error_handler(); - - foreach ($r as $pipe) { - // prior PHP 5.4 the array passed to stream_select is modified and - // lose key association, we have to find back the key - $read[$type = array_search($pipe, $this->pipes, true)] = ''; - - do { - $data = @fread($pipe, self::CHUNK_SIZE); - $read[$type] .= $data; - } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); - - if (!isset($read[$type][0])) { - unset($read[$type]); - } - - if ($close && feof($pipe)) { - fclose($pipe); - unset($this->pipes[$type]); - } - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - /** - * {@inheritdoc} - */ - public function areOpen(): bool - { - return (bool) $this->pipes; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/WindowsPipes.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/WindowsPipes.php deleted file mode 100644 index bca84f574d..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Pipes/WindowsPipes.php +++ /dev/null @@ -1,204 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Pipes; - -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; - -/** - * WindowsPipes implementation uses temporary files as handles. - * - * @see https://bugs.php.net/51800 - * @see https://bugs.php.net/65650 - * - * @author Romain Neutron - * - * @internal - */ -class WindowsPipes extends AbstractPipes -{ - private $files = []; - private $fileHandles = []; - private $lockHandles = []; - private $readBytes = [ - Process::STDOUT => 0, - Process::STDERR => 0, - ]; - private $haveReadSupport; - - public function __construct($input, bool $haveReadSupport) - { - $this->haveReadSupport = $haveReadSupport; - - if ($this->haveReadSupport) { - // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. - // Workaround for this problem is to use temporary files instead of pipes on Windows platform. - // - // @see https://bugs.php.net/51800 - $pipes = [ - Process::STDOUT => Process::OUT, - Process::STDERR => Process::ERR, - ]; - $tmpDir = sys_get_temp_dir(); - $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); - for ($i = 0;; ++$i) { - foreach ($pipes as $pipe => $name) { - $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); - - if (!$h = fopen($file.'.lock', 'w')) { - if (file_exists($file.'.lock')) { - continue 2; - } - restore_error_handler(); - throw new RuntimeException('A temporary file could not be opened to write the process output: '.$lastError); - } - if (!flock($h, \LOCK_EX | \LOCK_NB)) { - continue 2; - } - if (isset($this->lockHandles[$pipe])) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - } - $this->lockHandles[$pipe] = $h; - - if (!($h = fopen($file, 'w')) || !fclose($h) || !$h = fopen($file, 'r')) { - flock($this->lockHandles[$pipe], \LOCK_UN); - fclose($this->lockHandles[$pipe]); - unset($this->lockHandles[$pipe]); - continue 2; - } - $this->fileHandles[$pipe] = $h; - $this->files[$pipe] = $file; - } - break; - } - restore_error_handler(); - } - - parent::__construct($input); - } - - public function __sleep(): array - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - $this->close(); - } - - /** - * {@inheritdoc} - */ - public function getDescriptors(): array - { - if (!$this->haveReadSupport) { - $nullstream = fopen('NUL', 'c'); - - return [ - ['pipe', 'r'], - $nullstream, - $nullstream, - ]; - } - - // We're not using pipe on Windows platform as it hangs (https://bugs.php.net/51800) - // We're not using file handles as it can produce corrupted output https://bugs.php.net/65650 - // So we redirect output within the commandline and pass the nul device to the process - return [ - ['pipe', 'r'], - ['file', 'NUL', 'w'], - ['file', 'NUL', 'w'], - ]; - } - - /** - * {@inheritdoc} - */ - public function getFiles(): array - { - return $this->files; - } - - /** - * {@inheritdoc} - */ - public function readAndWrite(bool $blocking, bool $close = false): array - { - $this->unblock(); - $w = $this->write(); - $read = $r = $e = []; - - if ($blocking) { - if ($w) { - @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); - } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); - } - } - foreach ($this->fileHandles as $type => $fileHandle) { - $data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]); - - if (isset($data[0])) { - $this->readBytes[$type] += \strlen($data); - $read[$type] = $data; - } - if ($close) { - ftruncate($fileHandle, 0); - fclose($fileHandle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - unset($this->fileHandles[$type], $this->lockHandles[$type]); - } - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function haveReadSupport(): bool - { - return $this->haveReadSupport; - } - - /** - * {@inheritdoc} - */ - public function areOpen(): bool - { - return $this->pipes && $this->fileHandles; - } - - /** - * {@inheritdoc} - */ - public function close() - { - parent::close(); - foreach ($this->fileHandles as $type => $handle) { - ftruncate($handle, 0); - fclose($handle); - flock($this->lockHandles[$type], \LOCK_UN); - fclose($this->lockHandles[$type]); - } - $this->fileHandles = $this->lockHandles = []; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Process.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Process.php deleted file mode 100644 index 14e1777465..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/Process.php +++ /dev/null @@ -1,1652 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\ProcessSignaledException; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\PipesInterface; -use Symfony\Component\Process\Pipes\UnixPipes; -use Symfony\Component\Process\Pipes\WindowsPipes; - -/** - * Process is a thin wrapper around proc_* functions to easily - * start independent PHP processes. - * - * @author Fabien Potencier - * @author Romain Neutron - * - * @implements \IteratorAggregate - */ -class Process implements \IteratorAggregate -{ - public const ERR = 'err'; - public const OUT = 'out'; - - public const STATUS_READY = 'ready'; - public const STATUS_STARTED = 'started'; - public const STATUS_TERMINATED = 'terminated'; - - public const STDIN = 0; - public const STDOUT = 1; - public const STDERR = 2; - - // Timeout Precision in seconds. - public const TIMEOUT_PRECISION = 0.2; - - public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking - public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory - public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating - public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - - private $callback; - private $hasCallback = false; - private $commandline; - private $cwd; - private $env = []; - private $input; - private $starttime; - private $lastOutputTime; - private $timeout; - private $idleTimeout; - private $exitcode; - private $fallbackStatus = []; - private $processInformation; - private $outputDisabled = false; - private $stdout; - private $stderr; - private $process; - private $status = self::STATUS_READY; - private $incrementalOutputOffset = 0; - private $incrementalErrorOutputOffset = 0; - private $tty = false; - private $pty; - private $options = ['suppress_errors' => true, 'bypass_shell' => true]; - - private $useFileHandles = false; - /** @var PipesInterface */ - private $processPipes; - - private $latestSignal; - - private static $sigchild; - - /** - * Exit codes translation table. - * - * User-defined errors must use exit codes in the 64-113 range. - */ - public static $exitCodes = [ - 0 => 'OK', - 1 => 'General error', - 2 => 'Misuse of shell builtins', - - 126 => 'Invoked command cannot execute', - 127 => 'Command not found', - 128 => 'Invalid exit argument', - - // signals - 129 => 'Hangup', - 130 => 'Interrupt', - 131 => 'Quit and dump core', - 132 => 'Illegal instruction', - 133 => 'Trace/breakpoint trap', - 134 => 'Process aborted', - 135 => 'Bus error: "access to undefined portion of memory object"', - 136 => 'Floating point exception: "erroneous arithmetic operation"', - 137 => 'Kill (terminate immediately)', - 138 => 'User-defined 1', - 139 => 'Segmentation violation', - 140 => 'User-defined 2', - 141 => 'Write to pipe with no one reading', - 142 => 'Signal raised by alarm', - 143 => 'Termination (request to terminate)', - // 144 - not defined - 145 => 'Child process terminated, stopped (or continued*)', - 146 => 'Continue if stopped', - 147 => 'Stop executing temporarily', - 148 => 'Terminal stop signal', - 149 => 'Background process attempting to read from tty ("in")', - 150 => 'Background process attempting to write to tty ("out")', - 151 => 'Urgent data available on socket', - 152 => 'CPU time limit exceeded', - 153 => 'File size limit exceeded', - 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', - 155 => 'Profiling timer expired', - // 156 - not defined - 157 => 'Pollable event', - // 158 - not defined - 159 => 'Bad syscall', - ]; - - /** - * @param array $command The command to run and its arguments listed as separate entries - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @throws LogicException When proc_open is not installed - */ - public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - if (!\function_exists('proc_open')) { - throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); - } - - $this->commandline = $command; - $this->cwd = $cwd; - - // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected - // @see : https://bugs.php.net/51800 - // @see : https://bugs.php.net/50524 - if (null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR)) { - $this->cwd = getcwd(); - } - if (null !== $env) { - $this->setEnv($env); - } - - $this->setInput($input); - $this->setTimeout($timeout); - $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR; - $this->pty = false; - } - - /** - * Creates a Process instance as a command-line to be run in a shell wrapper. - * - * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.) - * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the - * shell wrapper and not to your commands. - * - * In order to inject dynamic values into command-lines, we strongly recommend using placeholders. - * This will save escaping values, which is not portable nor secure anyway: - * - * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"'); - * $process->run(null, ['MY_VAR' => $theValue]); - * - * @param string $command The command line to pass to the shell of the OS - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * - * @return static - * - * @throws LogicException When proc_open is not installed - */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) - { - $process = new static([], $cwd, $env, $input, $timeout); - $process->commandline = $command; - - return $process; - } - - /** - * @return array - */ - public function __sleep() - { - throw new \BadMethodCallException('Cannot serialize '.__CLASS__); - } - - public function __wakeup() - { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - public function __destruct() - { - if ($this->options['create_new_console'] ?? false) { - $this->processPipes->close(); - } else { - $this->stop(0); - } - } - - public function __clone() - { - $this->resetProcessData(); - } - - /** - * Runs the process. - * - * The callback receives the type of output (out or err) and - * some bytes from the output in real-time. It allows to have feedback - * from the independent process during execution. - * - * The STDOUT and STDERR are also available after the process is finished - * via the getOutput() and getErrorOutput() methods. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return int The exit status code - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException In case a callback is provided and output has been disabled - * - * @final - */ - public function run(callable $callback = null, array $env = []): int - { - $this->start($callback, $env); - - return $this->wait(); - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @return $this - * - * @throws ProcessFailedException if the process didn't terminate successfully - * - * @final - */ - public function mustRun(callable $callback = null, array $env = []): self - { - if (0 !== $this->run($callback, $env)) { - throw new ProcessFailedException($this); - } - - return $this; - } - - /** - * Starts the process and returns after writing the input to STDIN. - * - * This method blocks until all STDIN data is sent to the process then it - * returns while the process runs in the background. - * - * The termination of the process can be awaited with wait(). - * - * The callback receives the type of output (out or err) and some bytes from - * the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * @throws LogicException In case a callback is provided and output has been disabled - */ - public function start(callable $callback = null, array $env = []) - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $this->resetProcessData(); - $this->starttime = $this->lastOutputTime = microtime(true); - $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; - $descriptors = $this->getDescriptors(); - - if ($this->env) { - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; - } - - $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->getDefaultEnv(), $env, 'strcasecmp') : $this->getDefaultEnv(); - - if (\is_array($commandline = $this->commandline)) { - $commandline = implode(' ', array_map([$this, 'escapeArgument'], $commandline)); - - if ('\\' !== \DIRECTORY_SEPARATOR) { - // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$commandline; - } - } else { - $commandline = $this->replacePlaceholders($commandline, $env); - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) { - // last exit code is output on the fourth pipe and caught to work around --enable-sigchild - $descriptors[3] = ['pipe', 'w']; - - // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input - $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; - - // Workaround for the bug, when PTS functionality is enabled. - // @see : https://bugs.php.net/69442 - $ptsWorkaround = fopen(__FILE__, 'r'); - } - - $envPairs = []; - foreach ($env as $k => $v) { - if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) { - $envPairs[] = $k.'='.$v; - } - } - - if (!is_dir($this->cwd)) { - throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); - } - - $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - - if (!\is_resource($this->process)) { - throw new RuntimeException('Unable to launch a new process.'); - } - $this->status = self::STATUS_STARTED; - - if (isset($descriptors[3])) { - $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); - } - - if ($this->tty) { - return; - } - - $this->updateStatus(false); - $this->checkTimeout(); - } - - /** - * Restarts the process. - * - * Be warned that the process is cloned before being started. - * - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @return static - * - * @throws RuntimeException When process can't be launched - * @throws RuntimeException When process is already running - * - * @see start() - * - * @final - */ - public function restart(callable $callback = null, array $env = []): self - { - if ($this->isRunning()) { - throw new RuntimeException('Process is already running.'); - } - - $process = clone $this; - $process->start($callback, $env); - - return $process; - } - - /** - * Waits for the process to terminate. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @param callable|null $callback A valid PHP callback - * - * @return int The exitcode of the process - * - * @throws ProcessTimedOutException When process timed out - * @throws ProcessSignaledException When process stopped after receiving signal - * @throws LogicException When process is not yet started - */ - public function wait(callable $callback = null) - { - $this->requireProcessIsStarted(__FUNCTION__); - - $this->updateStatus(false); - - if (null !== $callback) { - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait".'); - } - $this->callback = $this->buildCallback($callback); - } - - do { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - } while ($running); - - while ($this->isRunning()) { - $this->checkTimeout(); - usleep(1000); - } - - if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { - throw new ProcessSignaledException($this); - } - - return $this->exitcode; - } - - /** - * Waits until the callback returns true. - * - * The callback receives the type of output (out or err) and some bytes - * from the output in real-time while writing the standard input to the process. - * It allows to have feedback from the independent process during execution. - * - * @throws RuntimeException When process timed out - * @throws LogicException When process is not yet started - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function waitUntil(callable $callback): bool - { - $this->requireProcessIsStarted(__FUNCTION__); - $this->updateStatus(false); - - if (!$this->processPipes->haveReadSupport()) { - $this->stop(0); - throw new LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".'); - } - $callback = $this->buildCallback($callback); - - $ready = false; - while (true) { - $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); - $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - foreach ($output as $type => $data) { - if (3 !== $type) { - $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready; - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - if ($ready) { - return true; - } - if (!$running) { - return false; - } - - usleep(1000); - } - } - - /** - * Returns the Pid (process identifier), if applicable. - * - * @return int|null The process id if running, null otherwise - */ - public function getPid() - { - return $this->isRunning() ? $this->processInformation['pid'] : null; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * - * @return $this - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - public function signal(int $signal) - { - $this->doSignal($signal, true); - - return $this; - } - - /** - * Disables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - * @throws LogicException if an idle timeout is set - */ - public function disableOutput() - { - if ($this->isRunning()) { - throw new RuntimeException('Disabling output while the process is running is not possible.'); - } - if (null !== $this->idleTimeout) { - throw new LogicException('Output cannot be disabled while an idle timeout is set.'); - } - - $this->outputDisabled = true; - - return $this; - } - - /** - * Enables fetching output and error output from the underlying process. - * - * @return $this - * - * @throws RuntimeException In case the process is already running - */ - public function enableOutput() - { - if ($this->isRunning()) { - throw new RuntimeException('Enabling output while the process is running is not possible.'); - } - - $this->outputDisabled = false; - - return $this; - } - - /** - * Returns true in case the output is disabled, false otherwise. - * - * @return bool - */ - public function isOutputDisabled() - { - return $this->outputDisabled; - } - - /** - * Returns the current output of the process (STDOUT). - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the output incrementally. - * - * In comparison with the getOutput method which always return the whole - * output, this one returns the new output since the last call. - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - $this->incrementalOutputOffset = ftell($this->stdout); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). - * - * @param int $flags A bit field of Process::ITER_* flags - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - * - * @return \Generator - */ - #[\ReturnTypeWillChange] - public function getIterator(int $flags = 0) - { - $this->readPipesForOutput(__FUNCTION__, false); - - $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); - $blocking = !(self::ITER_NON_BLOCKING & $flags); - $yieldOut = !(self::ITER_SKIP_OUT & $flags); - $yieldErr = !(self::ITER_SKIP_ERR & $flags); - - while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { - if ($yieldOut) { - $out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); - - if (isset($out[0])) { - if ($clearOutput) { - $this->clearOutput(); - } else { - $this->incrementalOutputOffset = ftell($this->stdout); - } - - yield self::OUT => $out; - } - } - - if ($yieldErr) { - $err = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - - if (isset($err[0])) { - if ($clearOutput) { - $this->clearErrorOutput(); - } else { - $this->incrementalErrorOutputOffset = ftell($this->stderr); - } - - yield self::ERR => $err; - } - } - - if (!$blocking && !isset($out[0]) && !isset($err[0])) { - yield self::OUT => ''; - } - - $this->checkTimeout(); - $this->readPipesForOutput(__FUNCTION__, $blocking); - } - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearOutput() - { - ftruncate($this->stdout, 0); - fseek($this->stdout, 0); - $this->incrementalOutputOffset = 0; - - return $this; - } - - /** - * Returns the current error output of the process (STDERR). - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getErrorOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { - return ''; - } - - return $ret; - } - - /** - * Returns the errorOutput incrementally. - * - * In comparison with the getErrorOutput method which always return the - * whole error output, this one returns the new error output since the last - * call. - * - * @return string - * - * @throws LogicException in case the output has been disabled - * @throws LogicException In case the process is not started - */ - public function getIncrementalErrorOutput() - { - $this->readPipesForOutput(__FUNCTION__); - - $latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); - $this->incrementalErrorOutputOffset = ftell($this->stderr); - - if (false === $latest) { - return ''; - } - - return $latest; - } - - /** - * Clears the process output. - * - * @return $this - */ - public function clearErrorOutput() - { - ftruncate($this->stderr, 0); - fseek($this->stderr, 0); - $this->incrementalErrorOutputOffset = 0; - - return $this; - } - - /** - * Returns the exit code returned by the process. - * - * @return int|null The exit status code, null if the Process is not terminated - */ - public function getExitCode() - { - $this->updateStatus(false); - - return $this->exitcode; - } - - /** - * Returns a string representation for the exit code returned by the process. - * - * This method relies on the Unix exit code status standardization - * and might not be relevant for other operating systems. - * - * @return string|null A string representation for the exit status code, null if the Process is not terminated - * - * @see http://tldp.org/LDP/abs/html/exitcodes.html - * @see http://en.wikipedia.org/wiki/Unix_signal - */ - public function getExitCodeText() - { - if (null === $exitcode = $this->getExitCode()) { - return null; - } - - return self::$exitCodes[$exitcode] ?? 'Unknown error'; - } - - /** - * Checks if the process ended successfully. - * - * @return bool - */ - public function isSuccessful() - { - return 0 === $this->getExitCode(); - } - - /** - * Returns true if the child process has been terminated by an uncaught signal. - * - * It always returns false on Windows. - * - * @return bool - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenSignaled() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['signaled']; - } - - /** - * Returns the number of the signal that caused the child process to terminate its execution. - * - * It is only meaningful if hasBeenSignaled() returns true. - * - * @return int - * - * @throws RuntimeException In case --enable-sigchild is activated - * @throws LogicException In case the process is not terminated - */ - public function getTermSignal() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) { - throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal cannot be retrieved.'); - } - - return $this->processInformation['termsig']; - } - - /** - * Returns true if the child process has been stopped by a signal. - * - * It always returns false on Windows. - * - * @return bool - * - * @throws LogicException In case the process is not terminated - */ - public function hasBeenStopped() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopped']; - } - - /** - * Returns the number of the signal that caused the child process to stop its execution. - * - * It is only meaningful if hasBeenStopped() returns true. - * - * @return int - * - * @throws LogicException In case the process is not terminated - */ - public function getStopSignal() - { - $this->requireProcessIsTerminated(__FUNCTION__); - - return $this->processInformation['stopsig']; - } - - /** - * Checks if the process is currently running. - * - * @return bool - */ - public function isRunning() - { - if (self::STATUS_STARTED !== $this->status) { - return false; - } - - $this->updateStatus(false); - - return $this->processInformation['running']; - } - - /** - * Checks if the process has been started with no regard to the current state. - * - * @return bool - */ - public function isStarted() - { - return self::STATUS_READY != $this->status; - } - - /** - * Checks if the process is terminated. - * - * @return bool - */ - public function isTerminated() - { - $this->updateStatus(false); - - return self::STATUS_TERMINATED == $this->status; - } - - /** - * Gets the process status. - * - * The status is one of: ready, started, terminated. - * - * @return string - */ - public function getStatus() - { - $this->updateStatus(false); - - return $this->status; - } - - /** - * Stops the process. - * - * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) - * - * @return int|null The exit-code of the process or null if it's not running - */ - public function stop(float $timeout = 10, int $signal = null) - { - $timeoutMicro = microtime(true) + $timeout; - if ($this->isRunning()) { - // given SIGTERM may not be defined and that "proc_terminate" uses the constant value and not the constant itself, we use the same here - $this->doSignal(15, false); - do { - usleep(1000); - } while ($this->isRunning() && microtime(true) < $timeoutMicro); - - if ($this->isRunning()) { - // Avoid exception here: process is supposed to be running, but it might have stopped just - // after this line. In any case, let's silently discard the error, we cannot do anything. - $this->doSignal($signal ?: 9, false); - } - } - - if ($this->isRunning()) { - if (isset($this->fallbackStatus['pid'])) { - unset($this->fallbackStatus['pid']); - - return $this->stop(0, $signal); - } - $this->close(); - } - - return $this->exitcode; - } - - /** - * Adds a line to the STDOUT stream. - * - * @internal - */ - public function addOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stdout, 0, \SEEK_END); - fwrite($this->stdout, $line); - fseek($this->stdout, $this->incrementalOutputOffset); - } - - /** - * Adds a line to the STDERR stream. - * - * @internal - */ - public function addErrorOutput(string $line) - { - $this->lastOutputTime = microtime(true); - - fseek($this->stderr, 0, \SEEK_END); - fwrite($this->stderr, $line); - fseek($this->stderr, $this->incrementalErrorOutputOffset); - } - - /** - * Gets the last output time in seconds. - */ - public function getLastOutputTime(): ?float - { - return $this->lastOutputTime; - } - - /** - * Gets the command line to be executed. - * - * @return string - */ - public function getCommandLine() - { - return \is_array($this->commandline) ? implode(' ', array_map([$this, 'escapeArgument'], $this->commandline)) : $this->commandline; - } - - /** - * Gets the process timeout in seconds (max. runtime). - * - * @return float|null - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Gets the process idle timeout in seconds (max. time since last output). - * - * @return float|null - */ - public function getIdleTimeout() - { - return $this->idleTimeout; - } - - /** - * Sets the process timeout (max. runtime) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws InvalidArgumentException if the timeout is negative - */ - public function setTimeout(?float $timeout) - { - $this->timeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Sets the process idle timeout (max. time since last output) in seconds. - * - * To disable the timeout, set this value to null. - * - * @return $this - * - * @throws LogicException if the output is disabled - * @throws InvalidArgumentException if the timeout is negative - */ - public function setIdleTimeout(?float $timeout) - { - if (null !== $timeout && $this->outputDisabled) { - throw new LogicException('Idle timeout cannot be set while the output is disabled.'); - } - - $this->idleTimeout = $this->validateTimeout($timeout); - - return $this; - } - - /** - * Enables or disables the TTY mode. - * - * @return $this - * - * @throws RuntimeException In case the TTY mode is not supported - */ - public function setTty(bool $tty) - { - if ('\\' === \DIRECTORY_SEPARATOR && $tty) { - throw new RuntimeException('TTY mode is not supported on Windows platform.'); - } - - if ($tty && !self::isTtySupported()) { - throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.'); - } - - $this->tty = $tty; - - return $this; - } - - /** - * Checks if the TTY mode is enabled. - * - * @return bool - */ - public function isTty() - { - return $this->tty; - } - - /** - * Sets PTY mode. - * - * @return $this - */ - public function setPty(bool $bool) - { - $this->pty = $bool; - - return $this; - } - - /** - * Returns PTY state. - * - * @return bool - */ - public function isPty() - { - return $this->pty; - } - - /** - * Gets the working directory. - * - * @return string|null - */ - public function getWorkingDirectory() - { - if (null === $this->cwd) { - // getcwd() will return false if any one of the parent directories does not have - // the readable or search mode set, even if the current directory does - return getcwd() ?: null; - } - - return $this->cwd; - } - - /** - * Sets the current working directory. - * - * @return $this - */ - public function setWorkingDirectory(string $cwd) - { - $this->cwd = $cwd; - - return $this; - } - - /** - * Gets the environment variables. - * - * @return array - */ - public function getEnv() - { - return $this->env; - } - - /** - * Sets the environment variables. - * - * @param array $env The new environment variables - * - * @return $this - */ - public function setEnv(array $env) - { - $this->env = $env; - - return $this; - } - - /** - * Gets the Process input. - * - * @return resource|string|\Iterator|null - */ - public function getInput() - { - return $this->input; - } - - /** - * Sets the input. - * - * This content will be passed to the underlying process standard input. - * - * @param string|int|float|bool|resource|\Traversable|null $input The content - * - * @return $this - * - * @throws LogicException In case the process is running - */ - public function setInput($input) - { - if ($this->isRunning()) { - throw new LogicException('Input cannot be set while the process is running.'); - } - - $this->input = ProcessUtils::validateInput(__METHOD__, $input); - - return $this; - } - - /** - * Performs a check between the timeout definition and the time the process started. - * - * In case you run a background process (with the start method), you should - * trigger this method regularly to ensure the process timeout - * - * @throws ProcessTimedOutException In case the timeout was reached - */ - public function checkTimeout() - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); - } - - if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { - $this->stop(0); - - throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); - } - } - - /** - * @throws LogicException in case process is not started - */ - public function getStartTime(): float - { - if (!$this->isStarted()) { - throw new LogicException('Start time is only available after process start.'); - } - - return $this->starttime; - } - - /** - * Defines options to pass to the underlying proc_open(). - * - * @see https://php.net/proc_open for the options supported by PHP. - * - * Enabling the "create_new_console" option allows a subprocess to continue - * to run after the main process exited, on both Windows and *nix - */ - public function setOptions(array $options) - { - if ($this->isRunning()) { - throw new RuntimeException('Setting options while the process is running is not possible.'); - } - - $defaultOptions = $this->options; - $existingOptions = ['blocking_pipes', 'create_process_group', 'create_new_console']; - - foreach ($options as $key => $value) { - if (!\in_array($key, $existingOptions)) { - $this->options = $defaultOptions; - throw new LogicException(sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); - } - $this->options[$key] = $value; - } - } - - /** - * Returns whether TTY is supported on the current operating system. - */ - public static function isTtySupported(): bool - { - static $isTtySupported; - - if (null === $isTtySupported) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); - } - - return $isTtySupported; - } - - /** - * Returns whether PTY is supported on the current operating system. - * - * @return bool - */ - public static function isPtySupported() - { - static $result; - - if (null !== $result) { - return $result; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - return $result = false; - } - - return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes); - } - - /** - * Creates the descriptors needed by the proc_open. - */ - private function getDescriptors(): array - { - if ($this->input instanceof \Iterator) { - $this->input->rewind(); - } - if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); - } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); - } - - return $this->processPipes->getDescriptors(); - } - - /** - * Builds up the callback used by wait(). - * - * The callbacks adds all occurred output to the specific buffer and calls - * the user callback (if present) with the received output. - * - * @param callable|null $callback The user defined PHP callback - * - * @return \Closure - */ - protected function buildCallback(callable $callback = null) - { - if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; - } - - $out = self::OUT; - - return function ($type, $data) use ($callback, $out): bool { - if ($out == $type) { - $this->addOutput($data); - } else { - $this->addErrorOutput($data); - } - - return null !== $callback && $callback($type, $data); - }; - } - - /** - * Updates the status of the process, reads pipes. - * - * @param bool $blocking Whether to use a blocking read call - */ - protected function updateStatus(bool $blocking) - { - if (self::STATUS_STARTED !== $this->status) { - return; - } - - $this->processInformation = proc_get_status($this->process); - $running = $this->processInformation['running']; - - $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); - - if ($this->fallbackStatus && $this->isSigchildEnabled()) { - $this->processInformation = $this->fallbackStatus + $this->processInformation; - } - - if (!$running) { - $this->close(); - } - } - - /** - * Returns whether PHP has been compiled with the '--enable-sigchild' option or not. - * - * @return bool - */ - protected function isSigchildEnabled() - { - if (null !== self::$sigchild) { - return self::$sigchild; - } - - if (!\function_exists('phpinfo')) { - return self::$sigchild = false; - } - - ob_start(); - phpinfo(\INFO_GENERAL); - - return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild'); - } - - /** - * Reads pipes for the freshest output. - * - * @param string $caller The name of the method that needs fresh outputs - * @param bool $blocking Whether to use blocking calls or not - * - * @throws LogicException in case output has been disabled or process is not started - */ - private function readPipesForOutput(string $caller, bool $blocking = false) - { - if ($this->outputDisabled) { - throw new LogicException('Output has been disabled.'); - } - - $this->requireProcessIsStarted($caller); - - $this->updateStatus($blocking); - } - - /** - * Validates and returns the filtered timeout. - * - * @throws InvalidArgumentException if the given timeout is a negative number - */ - private function validateTimeout(?float $timeout): ?float - { - $timeout = (float) $timeout; - - if (0.0 === $timeout) { - $timeout = null; - } elseif ($timeout < 0) { - throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); - } - - return $timeout; - } - - /** - * Reads pipes, executes callback. - * - * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close file handles or not - */ - private function readPipes(bool $blocking, bool $close) - { - $result = $this->processPipes->readAndWrite($blocking, $close); - - $callback = $this->callback; - foreach ($result as $type => $data) { - if (3 !== $type) { - $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data); - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; - } - } - } - - /** - * Closes process resource, closes file handles, sets the exitcode. - * - * @return int The exitcode - */ - private function close(): int - { - $this->processPipes->close(); - if (\is_resource($this->process)) { - proc_close($this->process); - } - $this->exitcode = $this->processInformation['exitcode']; - $this->status = self::STATUS_TERMINATED; - - if (-1 === $this->exitcode) { - if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { - // if process has been signaled, no exitcode but a valid termsig, apply Unix convention - $this->exitcode = 128 + $this->processInformation['termsig']; - } elseif ($this->isSigchildEnabled()) { - $this->processInformation['signaled'] = true; - $this->processInformation['termsig'] = -1; - } - } - - // Free memory from self-reference callback created by buildCallback - // Doing so in other contexts like __destruct or by garbage collector is ineffective - // Now pipes are closed, so the callback is no longer necessary - $this->callback = null; - - return $this->exitcode; - } - - /** - * Resets data related to the latest run of the process. - */ - private function resetProcessData() - { - $this->starttime = null; - $this->callback = null; - $this->exitcode = null; - $this->fallbackStatus = []; - $this->processInformation = null; - $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); - $this->process = null; - $this->latestSignal = null; - $this->status = self::STATUS_READY; - $this->incrementalOutputOffset = 0; - $this->incrementalErrorOutputOffset = 0; - } - - /** - * Sends a POSIX signal to the process. - * - * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants) - * @param bool $throwException Whether to throw exception in case signal failed - * - * @throws LogicException In case the process is not running - * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed - * @throws RuntimeException In case of failure - */ - private function doSignal(int $signal, bool $throwException): bool - { - if (null === $pid = $this->getPid()) { - if ($throwException) { - throw new LogicException('Cannot send signal on a non running process.'); - } - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); - if ($exitCode && $this->isRunning()) { - if ($throwException) { - throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); - } - - return false; - } - } else { - if (!$this->isSigchildEnabled()) { - $ok = @proc_terminate($this->process, $signal); - } elseif (\function_exists('posix_kill')) { - $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { - $ok = false === fgets($pipes[2]); - } - if (!$ok) { - if ($throwException) { - throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal)); - } - - return false; - } - } - - $this->latestSignal = $signal; - $this->fallbackStatus['signaled'] = true; - $this->fallbackStatus['exitcode'] = -1; - $this->fallbackStatus['termsig'] = $this->latestSignal; - - return true; - } - - private function prepareWindowsCommandLine(string $cmd, array &$env): string - { - $uid = uniqid('', true); - $varCount = 0; - $varCache = []; - $cmd = preg_replace_callback( - '/"(?:( - [^"%!^]*+ - (?: - (?: !LF! | "(?:\^[%!^])?+" ) - [^"%!^]*+ - )++ - ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { - if (!isset($m[1])) { - return $m[0]; - } - if (isset($varCache[$m[0]])) { - return $varCache[$m[0]]; - } - if (str_contains($value = $m[1], "\0")) { - $value = str_replace("\0", '?', $value); - } - if (false === strpbrk($value, "\"%!\n")) { - return '"'.$value.'"'; - } - - $value = str_replace(['!LF!', '"^!"', '"^%"', '"^^"', '""'], ["\n", '!', '%', '^', '"'], $value); - $value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; - $var = $uid.++$varCount; - - $env[$var] = $value; - - return $varCache[$m[0]] = '!'.$var.'!'; - }, - $cmd - ); - - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; - foreach ($this->processPipes->getFiles() as $offset => $filename) { - $cmd .= ' '.$offset.'>"'.$filename.'"'; - } - - return $cmd; - } - - /** - * Ensures the process is running or terminated, throws a LogicException if the process has a not started. - * - * @throws LogicException if the process has not run - */ - private function requireProcessIsStarted(string $functionName) - { - if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); - } - } - - /** - * Ensures the process is terminated, throws a LogicException if the process has a status different than "terminated". - * - * @throws LogicException if the process is not yet terminated - */ - private function requireProcessIsTerminated(string $functionName) - { - if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); - } - } - - /** - * Escapes a string to be used as a shell argument. - */ - private function escapeArgument(?string $argument): string - { - if ('' === $argument || null === $argument) { - return '""'; - } - if ('\\' !== \DIRECTORY_SEPARATOR) { - return "'".str_replace("'", "'\\''", $argument)."'"; - } - if (str_contains($argument, "\0")) { - $argument = str_replace("\0", '?', $argument); - } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { - return $argument; - } - $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - - return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; - } - - private function replacePlaceholders(string $commandline, array $env) - { - return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { - if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); - } - - return $this->escapeArgument($env[$matches[1]]); - }, $commandline); - } - - private function getDefaultEnv(): array - { - $env = getenv(); - $env = ('\\' === \DIRECTORY_SEPARATOR ? array_intersect_ukey($env, $_SERVER, 'strcasecmp') : array_intersect_key($env, $_SERVER)) ?: $env; - - return $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ProcessUtils.php b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ProcessUtils.php deleted file mode 100644 index 6cc7a610bc..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/ProcessUtils.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process; - -use Symfony\Component\Process\Exception\InvalidArgumentException; - -/** - * ProcessUtils is a bunch of utility methods. - * - * This class contains static methods only and is not meant to be instantiated. - * - * @author Martin Hasoň - */ -class ProcessUtils -{ - /** - * This class should not be instantiated. - */ - private function __construct() - { - } - - /** - * Validates and normalizes a Process input. - * - * @param string $caller The name of method call that validates the input - * @param mixed $input The input to validate - * - * @return mixed - * - * @throws InvalidArgumentException In case the input is not valid - */ - public static function validateInput(string $caller, $input) - { - if (null !== $input) { - if (\is_resource($input)) { - return $input; - } - if (\is_string($input)) { - return $input; - } - if (is_scalar($input)) { - return (string) $input; - } - if ($input instanceof Process) { - return $input->getIterator($input::ITER_SKIP_ERR); - } - if ($input instanceof \Iterator) { - return $input; - } - if ($input instanceof \Traversable) { - return new \IteratorIterator($input); - } - - throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); - } - - return $input; - } -} diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/README.md b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/README.md deleted file mode 100644 index 8777de4a65..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Process Component -================= - -The Process component executes commands in sub-processes. - -Sponsor -------- - -The Process component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2]. - -As the creator of Symfony, SensioLabs supports companies using Symfony, with an -offering encompassing consultancy, expertise, services, training, and technical -assistance to ensure the success of web application development projects. - -Help Symfony by [sponsoring][3] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/process.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) - -[1]: https://symfony.com/backers -[2]: https://sensiolabs.com -[3]: https://symfony.com/sponsor diff --git a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/composer.json b/test/lib/drivers/webdriver/phpwebdriver/symfony/process/composer.json deleted file mode 100644 index 1669eba576..0000000000 --- a/test/lib/drivers/webdriver/phpwebdriver/symfony/process/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/process", - "type": "library", - "description": "Executes commands in sub-processes", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/test/lib/ui.php b/test/lib/ui.php index 42731b0302..1a9dc267f8 100644 --- a/test/lib/ui.php +++ b/test/lib/ui.php @@ -7,7 +7,7 @@ define('MODULE_ROOT', dirname(__FILE__, 2) . '/ui/'); include CONFIG_ROOT . '/config.php'; include __DIR__ . '/result.class.php'; -include __DIR__ . '/drivers/webdriver/webdriver.class.php'; +include __DIR__ . '/webdriver/webdriver.class.php'; $driver = new webdriver($config); /* Set the error reporting. */ diff --git a/test/lib/webdriver/composer.json b/test/lib/webdriver/composer.json new file mode 100644 index 0000000000..73c8cd4f35 --- /dev/null +++ b/test/lib/webdriver/composer.json @@ -0,0 +1,8 @@ +{ + "require": { + "php-webdriver/webdriver": "1.12.1.0", + "symfony/polyfill-mbstring": "v1.26.0", + "symfony/polyfill-php80": "v1.26.0", + "symfony/process": "v5.4.8" + } +} diff --git a/test/lib/drivers/webdriver/webdriver.class.php b/test/lib/webdriver/webdriver.class.php similarity index 99% rename from test/lib/drivers/webdriver/webdriver.class.php rename to test/lib/webdriver/webdriver.class.php index 5c79c9352b..13b2ecc1c3 100644 --- a/test/lib/drivers/webdriver/webdriver.class.php +++ b/test/lib/webdriver/webdriver.class.php @@ -11,7 +11,7 @@ use Facebook\WebDriver\WebDriverDimension; use function zin\globalSearch; -require_once('phpwebdriver/autoload.php'); +require_once('vendor/autoload.php'); /** * Webdriver engine class. @@ -46,7 +46,7 @@ class webdriver $this->config = $config;; $this->initBrowser($config->chrome); - $this->cookieFile = dirname(__FILE__, 4) . '/config/cookie/cookie'; + $this->cookieFile = dirname(__FILE__, 3) . '/config/cookie/cookie'; } /** @@ -118,7 +118,7 @@ class webdriver $langName = 'en'; } - $langFile = dirname(__FILE__, 4) . "/lang/{$langName}.php"; + $langFile = dirname(__FILE__, 3) . "/lang/{$langName}.php"; if(file_exists($langFile)) include $langFile;