TimeTrex Community Edition v16.2.0
This commit is contained in:
118
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/Autoload.php
vendored
Normal file
118
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/Autoload.php
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit
|
||||
*
|
||||
* Copyright (c) 2002-2013, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHPUnit_Selenium
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright 2002-2010 Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://www.phpunit.de/
|
||||
* @since File available since Release 1.1.0
|
||||
*/
|
||||
|
||||
require_once 'File/Iterator/Autoload.php';
|
||||
|
||||
spl_autoload_register(
|
||||
function ($class) {
|
||||
static $classes = NULL;
|
||||
static $path = NULL;
|
||||
|
||||
if ($classes === NULL) {
|
||||
$classes = array(
|
||||
'phpunit_extensions_selenium2testcase' => '/Extensions/Selenium2TestCase.php',
|
||||
'phpunit_extensions_selenium2testcase_command' => '/Extensions/Selenium2TestCase/Command.php',
|
||||
'phpunit_extensions_selenium2testcase_commandsholder' => '/Extensions/Selenium2TestCase/CommandsHolder.php',
|
||||
'phpunit_extensions_selenium2testcase_driver' => '/Extensions/Selenium2TestCase/Driver.php',
|
||||
'phpunit_extensions_selenium2testcase_element' => '/Extensions/Selenium2TestCase/Element.php',
|
||||
'phpunit_extensions_selenium2testcase_element_accessor' => '/Extensions/Selenium2TestCase/Element/Accessor.php',
|
||||
'phpunit_extensions_selenium2testcase_element_select' => '/Extensions/Selenium2TestCase/Element/Select.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_attribute' => '/Extensions/Selenium2TestCase/ElementCommand/Attribute.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_click' => '/Extensions/Selenium2TestCase/ElementCommand/Click.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_css' => '/Extensions/Selenium2TestCase/ElementCommand/Css.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_equals' => '/Extensions/Selenium2TestCase/ElementCommand/Equals.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_genericaccessor' => '/Extensions/Selenium2TestCase/ElementCommand/GenericAccessor.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_genericpost' => '/Extensions/Selenium2TestCase/ElementCommand/GenericPost.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcommand_value' => '/Extensions/Selenium2TestCase/ElementCommand/Value.php',
|
||||
'phpunit_extensions_selenium2testcase_elementcriteria' => '/Extensions/Selenium2TestCase/ElementCriteria.php',
|
||||
'phpunit_extensions_selenium2testcase_exception' => '/Extensions/Selenium2TestCase/Exception.php',
|
||||
'phpunit_extensions_selenium2testcase_keys' => '/Extensions/Selenium2TestCase/Keys.php',
|
||||
'phpunit_extensions_selenium2testcase_keysholder' => '/Extensions/Selenium2TestCase/KeysHolder.php',
|
||||
'phpunit_extensions_selenium2testcase_noseleniumexception' => '/Extensions/Selenium2TestCase/NoSeleniumException.php',
|
||||
'phpunit_extensions_selenium2testcase_response' => '/Extensions/Selenium2TestCase/Response.php',
|
||||
'phpunit_extensions_selenium2testcase_screenshotlistener' => '/Extensions/Selenium2TestCase/ScreenshotListener.php',
|
||||
'phpunit_extensions_selenium2testcase_session' => '/Extensions/Selenium2TestCase/Session.php',
|
||||
'phpunit_extensions_selenium2testcase_session_cookie' => '/Extensions/Selenium2TestCase/Session/Cookie.php',
|
||||
'phpunit_extensions_selenium2testcase_session_cookie_builder' => '/Extensions/Selenium2TestCase/Session/Cookie/Builder.php',
|
||||
'phpunit_extensions_selenium2testcase_session_storage' => '/Extensions/Selenium2TestCase/Session/Storage.php',
|
||||
'phpunit_extensions_selenium2testcase_session_timeouts' => '/Extensions/Selenium2TestCase/Session/Timeouts.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_acceptalert' => '/Extensions/Selenium2TestCase/SessionCommand/AcceptAlert.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_active' => '/Extensions/Selenium2TestCase/SessionCommand/Active.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_alerttext' => '/Extensions/Selenium2TestCase/SessionCommand/AlertText.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_click' => '/Extensions/Selenium2TestCase/SessionCommand/Click.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_dismissalert' => '/Extensions/Selenium2TestCase/SessionCommand/DismissAlert.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_file' => '/Extensions/Selenium2TestCase/SessionCommand/File.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_frame' => '/Extensions/Selenium2TestCase/SessionCommand/Frame.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_genericaccessor' => '/Extensions/Selenium2TestCase/SessionCommand/GenericAccessor.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_genericattribute' => '/Extensions/Selenium2TestCase/SessionCommand/GenericAttribute.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_keys' => '/Extensions/Selenium2TestCase/SessionCommand/Keys.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_location' => '/Extensions/Selenium2TestCase/SessionCommand/Location.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_moveto' => '/Extensions/Selenium2TestCase/SessionCommand/MoveTo.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_orientation' => '/Extensions/Selenium2TestCase/SessionCommand/Orientation.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_url' => '/Extensions/Selenium2TestCase/SessionCommand/Url.php',
|
||||
'phpunit_extensions_selenium2testcase_sessioncommand_window' => '/Extensions/Selenium2TestCase/SessionCommand/Window.php',
|
||||
'phpunit_extensions_selenium2testcase_sessionstrategy' => '/Extensions/Selenium2TestCase/SessionStrategy.php',
|
||||
'phpunit_extensions_selenium2testcase_sessionstrategy_isolated' => '/Extensions/Selenium2TestCase/SessionStrategy/Isolated.php',
|
||||
'phpunit_extensions_selenium2testcase_sessionstrategy_shared' => '/Extensions/Selenium2TestCase/SessionStrategy/Shared.php',
|
||||
'phpunit_extensions_selenium2testcase_statecommand' => '/Extensions/Selenium2TestCase/StateCommand.php',
|
||||
'phpunit_extensions_selenium2testcase_url' => '/Extensions/Selenium2TestCase/URL.php',
|
||||
'phpunit_extensions_selenium2testcase_waituntil' => '/Extensions/Selenium2TestCase/WaitUntil.php',
|
||||
'phpunit_extensions_selenium2testcase_webdriverexception' => '/Extensions/Selenium2TestCase/WebDriverException.php',
|
||||
'phpunit_extensions_selenium2testcase_window' => '/Extensions/Selenium2TestCase/Window.php',
|
||||
'phpunit_extensions_seleniumbrowsersuite' => '/Extensions/SeleniumBrowserSuite.php',
|
||||
'phpunit_extensions_seleniumcommon_remotecoverage' => '/Extensions/SeleniumCommon/RemoteCoverage.php',
|
||||
'phpunit_extensions_seleniumcommon_exithandler' => '/Extensions/SeleniumCommon/ExitHandler.php',
|
||||
'phpunit_extensions_seleniumtestsuite' => '/Extensions/SeleniumTestSuite.php'
|
||||
);
|
||||
|
||||
$path = dirname(dirname(dirname(__FILE__)));
|
||||
}
|
||||
|
||||
$cn = strtolower($class);
|
||||
|
||||
if (isset($classes[$cn])) {
|
||||
require $path . $classes[$cn];
|
||||
}
|
||||
}
|
||||
);
|
66
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/Autoload.php.in
vendored
Normal file
66
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/Autoload.php.in
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit
|
||||
*
|
||||
* Copyright (c) 2002-2013, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHPUnit_Selenium
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright 2002-2010 Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://www.phpunit.de/
|
||||
* @since File available since Release 1.1.0
|
||||
*/
|
||||
|
||||
require_once 'File/Iterator/Autoload.php';
|
||||
|
||||
spl_autoload_register(
|
||||
function ($class) {
|
||||
static $classes = NULL;
|
||||
static $path = NULL;
|
||||
|
||||
if ($classes === NULL) {
|
||||
$classes = array(
|
||||
___CLASSLIST___
|
||||
);
|
||||
|
||||
$path = dirname(dirname(dirname(__FILE__)));
|
||||
}
|
||||
|
||||
$cn = strtolower($class);
|
||||
|
||||
if (isset($classes[$cn])) {
|
||||
require $path . $classes[$cn];
|
||||
}
|
||||
}
|
||||
);
|
34
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/ExitHandler.php
vendored
Normal file
34
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/ExitHandler.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace PHPUnit\Extensions\SeleniumCommon;
|
||||
|
||||
/**
|
||||
* If Ececution was stopped by calling exit();
|
||||
* php does not append append.php, so no code coverage date is collected
|
||||
* We have to add shutdown handler to append this file manualy.
|
||||
* @author Arbuzov <info@whitediver.com>
|
||||
*
|
||||
*/
|
||||
class ExitHandler
|
||||
{
|
||||
/**
|
||||
* Register handler.
|
||||
* If project have own shutdown hanldler user have to add function to handler
|
||||
*
|
||||
*/
|
||||
public static function init()
|
||||
{
|
||||
register_shutdown_function(array(ExitHandler::class, 'handle'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Manual include apendable files
|
||||
*/
|
||||
public static function handle()
|
||||
{
|
||||
$execFile = ini_get('auto_append_file');
|
||||
if ($execFile!=='') {
|
||||
include_once ($execFile);
|
||||
}
|
||||
}
|
||||
}
|
78
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/RemoteCoverage.php
vendored
Normal file
78
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/RemoteCoverage.php
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace PHPUnit\Extensions\SeleniumCommon;
|
||||
|
||||
use Exception;
|
||||
|
||||
class RemoteCoverage
|
||||
{
|
||||
public function __construct($coverageScriptUrl, $testId)
|
||||
{
|
||||
$this->coverageScriptUrl = $coverageScriptUrl;
|
||||
$this->testId = $testId;
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
if (!empty($this->coverageScriptUrl)) {
|
||||
$url = sprintf(
|
||||
'%s?PHPUNIT_SELENIUM_TEST_ID=%s',
|
||||
$this->coverageScriptUrl,
|
||||
urlencode($this->testId)
|
||||
);
|
||||
|
||||
$buffer = @file_get_contents($url);
|
||||
|
||||
if ($buffer !== FALSE) {
|
||||
$coverageData = unserialize($buffer);
|
||||
if (is_array($coverageData)) {
|
||||
return $this->matchLocalAndRemotePaths($coverageData);
|
||||
} else {
|
||||
throw new Exception('Empty or invalid code coverage data received from url "' . $url . '" (' . var_export($buffer, true) . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $coverage
|
||||
* @return array
|
||||
* @author Mattis Stordalen Flister <mattis@xait.no>
|
||||
*/
|
||||
protected function matchLocalAndRemotePaths(array $coverage)
|
||||
{
|
||||
$coverageWithLocalPaths = array();
|
||||
|
||||
foreach ($coverage as $originalRemotePath => $data) {
|
||||
$remotePath = $originalRemotePath;
|
||||
$separator = $this->findDirectorySeparator($remotePath);
|
||||
|
||||
while (!($localpath = stream_resolve_include_path($remotePath)) &&
|
||||
strpos($remotePath, $separator) !== FALSE) {
|
||||
$remotePath = substr($remotePath, strpos($remotePath, $separator) + 1);
|
||||
}
|
||||
|
||||
if ($localpath && md5_file($localpath) == $data['md5']) {
|
||||
$coverageWithLocalPaths[$localpath] = $data['coverage'];
|
||||
}
|
||||
}
|
||||
|
||||
return $coverageWithLocalPaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return string
|
||||
* @author Mattis Stordalen Flister <mattis@xait.no>
|
||||
*/
|
||||
protected function findDirectorySeparator($path)
|
||||
{
|
||||
if (strpos($path, '/') !== FALSE) {
|
||||
return '/';
|
||||
}
|
||||
|
||||
return '\\';
|
||||
}
|
||||
}
|
69
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php
vendored
Normal file
69
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit
|
||||
*
|
||||
* Copyright (c) 2010-2013, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHPUnit_Selenium
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright 2010-2013 Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://www.phpunit.de/
|
||||
* @since File available since Release 1.0.0
|
||||
*/
|
||||
|
||||
if ( isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) &&
|
||||
!isset($_GET['PHPUNIT_SELENIUM_TEST_ID']) &&
|
||||
extension_loaded('xdebug')) {
|
||||
$GLOBALS['PHPUNIT_FILTERED_FILES'][] = __FILE__;
|
||||
|
||||
$data = xdebug_get_code_coverage();
|
||||
xdebug_stop_code_coverage();
|
||||
|
||||
foreach ($GLOBALS['PHPUNIT_FILTERED_FILES'] as $file) {
|
||||
unset($data[$file]);
|
||||
}
|
||||
|
||||
if (is_string($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY']) &&
|
||||
is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {
|
||||
$file = $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] .
|
||||
DIRECTORY_SEPARATOR . md5($_SERVER['SCRIPT_FILENAME']);
|
||||
} else {
|
||||
$file = $_SERVER['SCRIPT_FILENAME'];
|
||||
}
|
||||
|
||||
$sanitizedCookieName = str_replace(array('\\'), '_', $_COOKIE['PHPUNIT_SELENIUM_TEST_ID']);
|
||||
$fullPath = $file . '.' . md5(uniqid(rand(), TRUE)) . '.' . $sanitizedCookieName;
|
||||
|
||||
file_put_contents($fullPath, serialize($data));
|
||||
}
|
95
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php
vendored
Normal file
95
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit
|
||||
*
|
||||
* Copyright (c) 2010-2013, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHPUnit_Selenium
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright 2010-2013 Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://www.phpunit.de/
|
||||
* @since File available since Release 1.0.0
|
||||
*/
|
||||
|
||||
$directory = realpath(__DIR__);
|
||||
while ($directory != '/') {
|
||||
$autoloadCandidate = $directory . '/vendor/autoload.php';
|
||||
if (file_exists($autoloadCandidate)) {
|
||||
require_once $autoloadCandidate;
|
||||
break;
|
||||
}
|
||||
$directory = realpath($directory . '/..');
|
||||
}
|
||||
|
||||
// Set this to the directory that contains the code coverage files.
|
||||
// It defaults to getcwd(). If you have configured a different directory
|
||||
// in prepend.php, you need to configure the same directory here.
|
||||
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = getcwd();
|
||||
|
||||
if (isset($_GET['PHPUNIT_SELENIUM_TEST_ID'])) {
|
||||
$facade = new \SebastianBergmann\FileIterator\Facade();
|
||||
$sanitizedCookieName = str_replace(array('\\'), '_', $_GET['PHPUNIT_SELENIUM_TEST_ID']);
|
||||
$files = $facade->getFilesAsArray(
|
||||
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'],
|
||||
$sanitizedCookieName
|
||||
);
|
||||
|
||||
$coverage = array();
|
||||
|
||||
foreach ($files as $file) {
|
||||
$data = unserialize(file_get_contents($file));
|
||||
unlink($file);
|
||||
unset($file);
|
||||
$filter = new \SebastianBergmann\CodeCoverage\Filter();
|
||||
|
||||
foreach ($data as $file => $lines) {
|
||||
if ($filter->isFile($file)) {
|
||||
if (!isset($coverage[$file])) {
|
||||
$coverage[$file] = array(
|
||||
'md5' => md5_file($file), 'coverage' => $lines
|
||||
);
|
||||
} else {
|
||||
foreach ($lines as $line => $flag) {
|
||||
if (!isset($coverage[$file]['coverage'][$line]) ||
|
||||
$flag > $coverage[$file]['coverage'][$line]) {
|
||||
$coverage[$file]['coverage'][$line] = $flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print serialize($coverage);
|
||||
}
|
67
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php
vendored
Normal file
67
vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit
|
||||
*
|
||||
* Copyright (c) 2010-2013, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the name of Sebastian Bergmann nor the names of his
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package PHPUnit_Selenium
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright 2010-2013 Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link http://www.phpunit.de/
|
||||
* @since File available since Release 1.0.0
|
||||
*/
|
||||
|
||||
use PHPUnit\Extensions\SeleniumCommon\ExitHandler;
|
||||
|
||||
// By default the code coverage files are written to the same directory
|
||||
// that contains the covered sourcecode files. Use this setting to change
|
||||
// the default behaviour and set a specific directory to write the files to.
|
||||
// If you change the default setting, please make sure to also configure
|
||||
// the same directory in phpunit_coverage.php. Also note that the webserver
|
||||
// needs write access to the directory.
|
||||
|
||||
if (!isset($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {
|
||||
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = FALSE;
|
||||
}
|
||||
|
||||
if ( isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) &&
|
||||
!isset($_GET['PHPUNIT_SELENIUM_TEST_ID']) &&
|
||||
extension_loaded('xdebug')) {
|
||||
$GLOBALS['PHPUNIT_FILTERED_FILES'] = array(__FILE__);
|
||||
|
||||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
|
||||
}
|
||||
|
||||
include ('ExitHandler.php');
|
||||
ExitHandler::init();
|
Reference in New Issue
Block a user