From 26a3f693171dfffc8e86bb199405c4b52f00a1fb Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Fri, 18 Aug 2017 16:05:08 +0200 Subject: [PATCH] Update new tests support (WIP) --- RoboFile.php | 781 ++++++++---------- codeception.yml | 13 +- composer.json | 11 +- composer.lock | 764 ++++++++++++----- tests/_bootstrap.php | 1 + tests/_support/Helper/Acceptance.php | 49 ++ tests/_support/Helper/Functional.php | 23 + tests/_support/Helper/JoomlaDb.php | 162 ++++ tests/_support/Helper/Unit.php | 23 + .../Acceptance/Administrator/AdminPage.php | 409 +++++++++ .../Administrator/UserManagerPage.php | 196 +++++ .../Page/Acceptance/Site/FrontPage.php | 44 + tests/_support/Shared/UserCredentials.php | 50 ++ tests/acceptance.suite.dist.yml | 40 +- .../acceptance/install/InstallJoomlaCest.php | 21 + .../install/InstallWeblinksCest.php | 11 +- tests/functional.suite.yml | 12 +- tests/functional/_bootstrap.php | 1 + tests/unit.suite.yml | 7 +- 19 files changed, 1955 insertions(+), 663 deletions(-) create mode 100644 tests/_support/Helper/Acceptance.php create mode 100644 tests/_support/Helper/Functional.php create mode 100644 tests/_support/Helper/JoomlaDb.php create mode 100644 tests/_support/Helper/Unit.php create mode 100644 tests/_support/Page/Acceptance/Administrator/AdminPage.php create mode 100644 tests/_support/Page/Acceptance/Administrator/UserManagerPage.php create mode 100644 tests/_support/Page/Acceptance/Site/FrontPage.php create mode 100644 tests/_support/Shared/UserCredentials.php create mode 100644 tests/acceptance/install/InstallJoomlaCest.php diff --git a/RoboFile.php b/RoboFile.php index 0bd8c45..e1abb21 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -1,18 +1,21 @@ configuration = $this->getConfiguration(); - - $this->cmsPath = $this->getCmsPath(); - + $this->configuration = $this->getConfiguration(); + $this->cmsPath = $this->getTestingPath(); $this->executableExtension = $this->getExecutableExtension(); // Set default timezone (so no warnings are generated if it is not set) @@ -77,234 +90,82 @@ class RoboFile extends \Robo\Tasks /** * Get the executable extension according to Operating System * - * @return void + * @return */ private function getExecutableExtension() { if ($this->isWindows()) { - // Check wehter git.exe or git as command should be used, - // As on window both is possible - if (!$this->_exec('git.exe --version')->getMessage()) - { - return ''; - } - else - { - return '.exe'; - } + return '.exe'; } return ''; } /** - * Executes all the Selenium System Tests in a suite on your machine + * Get (optional) configuration from an external file * - * @param array $opts Array of configuration options: - * - 'use-htaccess': renames and enable embedded Joomla .htaccess file - * - 'env': set a specific environment to get configuration from + * @since 3.7.3 * - * @return mixed + * @return \stdClass|null */ - public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) + public function getConfiguration() { - $this->createTestingSite($opts['use-htaccess']); + $configurationFile = __DIR__ . '/RoboFile.ini'; - $this->getComposer(); + if (!file_exists($configurationFile)) + { + $this->say('No local configuration file'); - $this->taskComposerInstall()->run(); - - $this->runSelenium(); - - // Make sure to run the build command to generate AcceptanceTester - $this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build'); - - $this->taskCodecept() - ->arg('--steps') - ->arg('--debug') - ->arg('--fail-fast') - ->env($opts['env']) - ->arg('tests/acceptance/install/') - ->run() - ->stopOnFail(); - - $this->taskCodecept() - ->arg('--steps') - ->arg('--debug') - ->arg('--fail-fast') - ->env($opts['env']) - ->arg('tests/acceptance/administrator/') - ->run() - ->stopOnFail(); - - $this->taskCodecept() - ->arg('--steps') - ->arg('--debug') - ->arg('--fail-fast') - ->env($opts['env']) - ->arg('tests/acceptance/frontend/') - ->run() - ->stopOnFail(); - - /* - Uncomment this lines if you need to debug selenium errors - $seleniumErrors = file_get_contents('selenium.log'); - if ($seleniumErrors) { - $this->say('Printing Selenium Log files'); - $this->say('------ selenium.log (start) ---------'); - $this->say($seleniumErrors); - $this->say('------ selenium.log (end) -----------'); + return null; } - */ + + $configuration = parse_ini_file($configurationFile); + + if ($configuration === false) + { + $this->say('Local configuration file is empty or wrong (check is it in correct .ini format'); + + return null; + } + + return json_decode(json_encode($configuration)); } /** - * Executes a specific Selenium System Tests in your machine + * Get the correct CMS root path * - * @param string $pathToTestFile Optional name of the test to be run - * @param string $suite Optional name of the suite containing the tests, Acceptance by default. + * @since 3.7.3 * - * @return mixed + * @return string */ - public function runTest($pathToTestFile = null, $suite = 'acceptance') + private function getTestingPath() { - $this->runSelenium(); - - // Make sure to run the build command to generate AcceptanceTester - $this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build'); - - if (!$pathToTestFile) + if (empty($this->configuration->cmsPath)) { - $this->say('Available tests in the system:'); - - $iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator( - 'tests/' . $suite, - RecursiveDirectoryIterator::SKIP_DOTS - ), - RecursiveIteratorIterator::SELF_FIRST - ); - - $tests = array(); - - $iterator->rewind(); - $i = 1; - - while ($iterator->valid()) - { - if (strripos($iterator->getSubPathName(), 'cept.php') - || strripos($iterator->getSubPathName(), 'cest.php')) - { - $this->say('[' . $i . '] ' . $iterator->getSubPathName()); - $tests[$i] = $iterator->getSubPathName(); - $i++; - } - - $iterator->next(); - } - - $this->say(''); - $testNumber = $this->ask('Type the number of the test in the list that you want to run...'); - $test = $tests[$testNumber]; + return $this->testsPath . 'joomla'; } - $pathToTestFile = 'tests/' . $suite . '/' . $test; - - // Loading the class to display the methods in the class - require 'tests/' . $suite . '/' . $test; - - // Logic to fetch the class name from the file name - $fileName = explode("/", $test); - $className = explode(".", $fileName[1]); - - // If the selected file is cest only than we will give the option to execute individual methods, we don't need this in cept file - $i = 1; - - if (strripos($className[0], 'cest')) + if (!file_exists(dirname($this->configuration->cmsPath))) { - $class_methods = get_class_methods($className[0]); - $this->say('[' . $i . '] ' . 'All'); - $methods[$i] = 'All'; - $i++; + $this->say('CMS path written in local configuration does not exists or is not readable'); - foreach ($class_methods as $method_name) - { - $reflect = new ReflectionMethod($className[0], $method_name); - - if (!$reflect->isConstructor()) - { - if ($reflect->isPublic()) - { - $this->say('[' . $i . '] ' . $method_name); - $methods[$i] = $method_name; - $i++; - } - } - } - - $this->say(''); - $methodNumber = $this->ask('Please choose the method in the test that you would want to run...'); - $method = $methods[$methodNumber]; + return $this->testsPath . 'joomla'; } - if (isset($method) && $method != 'All') - { - $pathToTestFile = $pathToTestFile . ':' . $method; - } - - $this->taskCodecept() - ->test($pathToTestFile) - ->arg('--steps') - ->arg('--debug') - ->run() - ->stopOnFail(); - } - - /** - * Run the specified checker tool. Valid options are phpmd, phpcs, phpcpd - * - * @param string $tool The tool - * - * @return bool - */ - public function runChecker($tool = null) - { - if ($tool === null) - { - $this->say('You have to specify a tool name as argument. Valid tools are phpmd, phpcs, phpcpd.'); - - return false; - } - - if (!in_array($tool, array('phpmd', 'phpcs', 'phpcpd'))) - { - $this->say('The tool you required is not known. Valid tools are phpmd, phpcs, phpcpd.'); - - return false; - } - - switch ($tool) - { - case 'phpmd': - return $this->runPhpmd(); - - case 'phpcs': - return $this->runPhpcs(); - - case 'phpcpd': - return $this->runPhpcpd(); - } + return $this->configuration->cmsPath; } /** * Creates a testing Joomla site for running the tests (use it before run:test) * - * @param bool $use_htaccess (1/0) Rename and enable embedded Joomla .htaccess file + * @param bool $useHtaccess (1/0) Rename and enable embedded Joomla .htaccess file * - * @return bool + * @since 3.7.3 + * + * @return void */ - public function createTestingSite($use_htaccess = false) + public function createTestingSite($useHtaccess = false) { if (!empty($this->configuration->skipClone)) { @@ -314,11 +175,11 @@ class RoboFile extends \Robo\Tasks } // Caching cloned installations locally - if (!is_dir('tests/cache') || (time() - filemtime('tests/cache') > 60 * 60 * 24)) + if (!is_dir($this->testsPath . 'cache') || (time() - filemtime($this->testsPath . 'cache') > 60 * 60 * 24)) { - if (file_exists('tests/cache')) + if (file_exists($this->testsPath . 'cache')) { - $this->taskDeleteDir('tests/cache')->run(); + $this->taskDeleteDir($this->testsPath . 'cache')->run(); } $this->_exec($this->buildGitCloneCommand()); @@ -339,108 +200,101 @@ class RoboFile extends \Robo\Tasks } } - $this->_copyDir('tests/cache', $this->cmsPath); + $exclude = ['tests', 'tests-phpunit', '.run', '.github', '.git', '.drone', 'docs', 'src']; + + $this->copyJoomla($this->cmsPath, $exclude); // Optionally change owner to fix permissions issues - if (!empty($this->configuration->localUser) && !$this->isWindows()) + if (!empty($this->configuration->localUser)) { $this->_exec('chown -R ' . $this->configuration->localUser . ' ' . $this->cmsPath); } - // Copy current package - if (!file_exists('dist/pkg-weblinks-current.zip')) - { - $this->build(true); - } - $this->_copy('dist/pkg-weblinks-current.zip', $this->cmsPath . "/pkg-weblinks-current.zip"); - $this->say('Joomla CMS site created at ' . $this->cmsPath); - // Optionally uses Joomla default htaccess file. Used by TravisCI - if ($use_htaccess == true) + if ($useHtaccess == true) { - $this->_copy('./tests/joomla/htaccess.txt', './tests/joomla/.htaccess'); - $this->_exec('sed -e "s,# RewriteBase /,RewriteBase /tests/joomla/,g" -in-place tests/joomla/.htaccess'); + $this->say('Renaming htaccess.txt to .htaccess'); + $this->_copy('./htaccess.txt', $this->cmsPath . '/.htaccess'); + $this->_exec('sed -e "s,# RewriteBase /,RewriteBase /tests/joomla-cms,g" -in-place tests/joomla/.htaccess'); } } /** - * Get (optional) configuration from an external file + * Copy the Joomla installation excluding folders * - * @return \stdClass|null + * @param string $dst Target folder + * @param array $exclude Exclude list of folders + * + * @throws Exception + * + * @since 3.7.3 + * + * @return void */ - public function getConfiguration() + protected function copyJoomla($dst, $exclude = array()) { - $configurationFile = __DIR__ . '/RoboFile.ini'; + $dir = @opendir( "." . '/' . $this->testsPath . 'cache'); - if (!file_exists($configurationFile)) + if (false === $dir) { - $this->say("No local configuration file"); - - return null; + throw new Exception($this, "Cannot open source directory"); } - $configuration = parse_ini_file($configurationFile); - - if ($configuration === false) + if (!is_dir($dst)) { - $this->say('Local configuration file is empty or wrong (check is it in correct .ini format'); - - return null; + mkdir($dst, 0755, true); } - return json_decode(json_encode($configuration)); + while (false !== ($file = readdir($dir))) + { + if (in_array($file, $exclude)) + { + continue; + } + + if (($file !== '.') && ($file !== '..')) + { + $srcFile = "." . '/' . $this->testsPath . 'cache/' . $file; + $destFile = $dst . '/' . $file; + + if (is_dir($srcFile)) + { + $this->_copyDir($srcFile, $destFile); + } + else + { + copy($srcFile, $destFile); + } + } + } + + closedir($dir); } /** - * Build correct git clone command according to local configuration and OS + * Downloads Composer * - * @return string - */ - private function buildGitCloneCommand() - { - $branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch; - - return "git" . $this->executableExtension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache"; - } - - /** - * Check if local OS is Windows + * @since 3.7.3 * - * @return bool + * @return void */ - private function isWindows() + private function getComposer() { - return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; - } - - /** - * Get the correct CMS root path - * - * @return string - */ - private function getCmsPath() - { - if (empty($this->configuration->cmsPath)) + // Make sure we have Composer + if (!file_exists('composer.phar')) { - return 'tests/joomla'; + $this->_exec('curl -o ' . 'composer.phar --retry 3 --retry-delay 5 -sS https://getcomposer.org/installer | php'); } - - if (!file_exists(dirname($this->configuration->cmsPath))) - { - $this->say("Cms path written in local configuration does not exists or is not readable"); - - return 'tests/joomla'; - } - - return $this->configuration->cmsPath; } /** * Runs Selenium Standalone Server. * - * @return void + * @since 3.7.3 + * + * @return void */ public function runSelenium() { @@ -450,137 +304,219 @@ class RoboFile extends \Robo\Tasks } else { - $this->_exec('START java.exe -jar' . $this->getWebDriver() . - ' vendor\joomla-projects\selenium-server-standalone\bin\selenium-server-standalone.jar '); + $this->_exec("START java.exe -jar " . $this->getWebDriver() . ' vendor\joomla-projects\selenium-server-standalone\bin\selenium-server-standalone.jar '); } + sleep(3); + } + + /** + * Executes all the Selenium System Tests in a suite on your machine + * + * @param array $opts Array of configuration options: + * - 'use-htaccess': renames and enable embedded Joomla .htaccess file + * - 'env': set a specific environment to get configuration from + * + * @since 3.7.3 + * + * @return mixed + */ + public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) + { + $this->say("Running tests"); + + $this->createTestingSite($opts['use-htaccess']); + + $this->getComposer(); + if ($this->isWindows()) { - sleep(3); + $this->taskComposerInstall('composer')->run(); } else { - $this->taskWaitForSeleniumStandaloneServer() - ->run() - ->stopOnFail(); - } - } - - /** - * Downloads Composer - * - * @return void - */ - private function getComposer() - { - // Make sure we have Composer - if (!file_exists('./composer.phar')) - { - $insecure = ''; - - if (!empty($this->configuration->insecure)) - { - $insecure = '--insecure'; - } - - $this->_exec('curl ' . $insecure . ' --retry 3 --retry-delay 5 -sS https://getcomposer.org/installer | php'); - } - } - - /** - * Kills the selenium server running - * - * @param string $host Web host of the remote server. - * @param string $port Server port. - * - * @return void - */ - public function killSelenium($host = 'localhost', $port = '4444') - { - $this->say('Trying to kill the selenium server.'); - $this->_exec("curl http://$host:$port/selenium-server/driver/?cmd=shutDownSeleniumServer"); - } - - /** - * Run the phpmd tool - * - * @return void - */ - private function runPhpmd() - { - return $this->_exec('phpmd' . $this->extension . ' ' . __DIR__ . '/src xml cleancode,codesize,controversial,design,naming,unusedcode'); - } - - /** - * Run the phpcs tool - * - * @return void - */ - private function runPhpcs() - { - $this->_exec('phpcs' . $this->extension . ' ' . __DIR__ . '/src'); - } - - /** - * Run the phpcpd tool - * - * @return void - */ - private function runPhpcpd() - { - $this->_exec('phpcpd' . $this->extension . ' ' . __DIR__ . '/src'); - } - - /** - * Build the joomla extension package - * - * @param array $params Additional params - * - * @return void - */ - public function build($params = ['dev' => false]) - { - if (!file_exists('jorobo.ini')) - { - $this->_copy('jorobo.dist.ini', 'jorobo.ini'); + $this->taskComposerInstall('composer.phar')->run(); } - $this->taskBuild($params)->run(); - } - - /** - * Executes all unit tests - * - * @return void - */ - public function runUnit() - { - $this->createTestingSite(); - $this->getComposer(); - $this->taskComposerInstall()->run(); + $this->runSelenium(); // Make sure to run the build command to generate AcceptanceTester - $this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build'); + if ($this->isWindows()) + { + $this->_exec('php ' . $this->getWindowsPath('vendor/bin/codecept') . ' build'); + $pathToCodeception = $this->getWindowsPath('vendor/bin/codecept'); + } + else + { + $this->_exec('php ' . 'vendor/bin/codecept build'); - $this->taskCodecept() - ->suite('unit') + $pathToCodeception = 'vendor/bin/codecept'; + } + + $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->env($opts['env']) + ->arg($this->testsPath . 'acceptance/install/') + ->run() + ->stopOnFail(); + + $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->env($opts['env']) + ->arg($this->testsPath . 'acceptance/administrator/') + ->run() + ->stopOnFail(); + + $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->env($opts['env']) + ->arg($this->testsPath . 'acceptance/frontend/') ->run() ->stopOnFail(); } /** - * Update copyright headers for this project. (Set the text up in the jorobo.ini) + * Executes a specific Selenium System Tests in your machine + * + * @param string $pathToTestFile Optional name of the test to be run + * @param string $suite Optional name of the suite containing the tests, Acceptance by default. + * + * @since 3.7.3 * * @return void */ - public function headers() + public function runTest($pathToTestFile = null, $suite = 'acceptance') { - if (!file_exists('jorobo.ini')) + $this->runSelenium(); + + // Make sure to run the build command to generate AcceptanceTester + $path = 'vendor/bin/codecept'; + $this->_exec('php ' . $this->isWindows() ? $this->getWindowsPath($path) : $path . ' build'); + + if (!$pathToTestFile) { - $this->_copy('jorobo.dist.ini', 'jorobo.ini'); + $this->say('Available tests in the system:'); + + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator( + $this->testsPath . $suite, + RecursiveDirectoryIterator::SKIP_DOTS + ), + RecursiveIteratorIterator::SELF_FIRST + ); + + $tests = array(); + $i = 1; + + $iterator->rewind(); + + while ($iterator->valid()) + { + if (strripos($iterator->getSubPathName(), 'cept.php') + || strripos($iterator->getSubPathName(), 'cest.php') + || strripos($iterator->getSubPathName(), '.feature') + ) + { + $this->say('[' . $i . '] ' . $iterator->getSubPathName()); + + $tests[$i] = $iterator->getSubPathName(); + $i++; + } + + $iterator->next(); + } + + $this->say(''); + $testNumber = $this->ask('Type the number of the test in the list that you want to run...'); + $test = $tests[$testNumber]; } - (new \Joomla\Jorobo\Tasks\CopyrightHeader)->run(); + $pathToTestFile = $this->testsPath . $suite . '/' . $test; + + // Loading the class to display the methods in the class + + // Logic to fetch the class name from the file name + $fileName = explode("/", $test); + + // If the selected file is cest only then we will give the option to execute individual methods, we don't need this in cept or feature files + $i = 1; + + if (isset($fileName[1]) && strripos($fileName[1], 'cest')) + { + require $this->testsPath . $suite . '/' . $test; + + $className = explode(".", $fileName[1]); + $class_methods = get_class_methods($className[0]); + + $this->say('[' . $i . '] ' . 'All'); + + $methods[$i] = 'All'; + $i++; + + foreach ($class_methods as $method_name) + { + $reflect = new ReflectionMethod($className[0], $method_name); + + if (!$reflect->isConstructor() && $reflect->isPublic()) + { + $this->say('[' . $i . '] ' . $method_name); + + $methods[$i] = $method_name; + + $i++; + } + } + + $this->say(''); + $methodNumber = $this->ask('Please choose the method in the test that you would want to run...'); + $method = $methods[$methodNumber]; + } + + if (isset($method) && $method != 'All') + { + $pathToTestFile = $pathToTestFile . ':' . $method; + } + + $testPathCodecept = 'vendor/bin/codecept'; + + $this->taskCodecept($this->isWindows() ? $this->getWindowsPath($testPathCodecept) : $testPathCodecept) + ->test($pathToTestFile) + ->arg('--steps') + ->arg('--debug') + ->run() + ->stopOnFail(); + } + + /** + * Check if local OS is Windows + * + * @return bool + * + * @since 3.7.3 + */ + private function isWindows() + { + return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; + } + + /** + * Return the correct path for Windows (needed by CMD) + * + * @param string $path Linux path + * + * @return string + * + * @since 3.7.3 + */ + private function getWindowsPath($path) + { + return str_replace('/', DIRECTORY_SEPARATOR, $path); } /** @@ -588,7 +524,7 @@ class RoboFile extends \Robo\Tasks * * @return string the webdriver string to use with selenium * - * @since version + * @since 3.7.3 */ public function getWebdriver() { @@ -626,9 +562,7 @@ class RoboFile extends \Robo\Tasks } else { - $this->yell( - print_r($codeceptMainConfig) . - 'No driver for your browser. Check your browser in acceptance.suite.yml and the webDrivers in codeception.yml'); + $this->yell('No driver for your browser. Check your browser in acceptance.suite.yml and the webDrivers in codeception.yml'); // We can't do anything without a driver, exit exit(1); @@ -639,12 +573,38 @@ class RoboFile extends \Robo\Tasks return '-D' . implode('=', $driver); } + /** + * Return the os name + * + * @return string + * + * @since 3.7.3 + */ + private function getOs() + { + $os = php_uname('s'); + + if (strpos(strtolower($os), 'windows') !== false) + { + return 'windows'; + } + + if (strpos(strtolower($os), 'darwin') !== false) + { + return 'mac'; + } + + return 'linux'; + } + /** * Get the suite configuration * - * @param string $suite The suite + * @param string $suite Name of the test suite * - * @return array + * @return array + * + * @since 3.7.3 */ private function getSuiteConfig($suite = 'acceptance') { @@ -657,40 +617,15 @@ class RoboFile extends \Robo\Tasks } /** - * Return the os name + * Build correct git clone command according to local configuration and OS * * @return string - * - * @since version */ - private function getOs() + private function buildGitCloneCommand() { - $os = php_uname('s'); + $branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch; - if (strpos(strtolower($os), 'windows') !== false) - { - $os = 'windows'; - } - // Who have thought that Mac is actually Darwin??? - elseif (strpos(strtolower($os), 'darwin') !== false) - { - $os = 'mac'; - } - else - { - $os = 'linux'; - } - - return $os; - } - - /** - * Update Version __DEPLOY_VERSION__ in Weblinks. (Set the version up in the jorobo.ini) - * - * @return void - */ - public function bump() - { - (new \Joomla\Jorobo\Tasks\BumpVersion())->run(); + return "git clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git " . $this->testsPath . "cache"; } } + diff --git a/codeception.yml b/codeception.yml index 362549c..26e4c84 100644 --- a/codeception.yml +++ b/codeception.yml @@ -3,11 +3,22 @@ paths: tests: tests log: tests/_output data: tests/_data - helpers: tests/_support + support: tests/_support + envs: tests/_envs settings: bootstrap: _bootstrap.php colors: true memory_limit: 1024M +extensions: + enabled: + - Codeception\Extension\RunFailed +modules: + config: + Db: + dsn: '' + user: '' + password: '' + dump: tests/_data/dump.sql webdrivers: firefox: windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\gecko\geckodriver64.exe diff --git a/composer.json b/composer.json index e3a53fd..2fa0ac6 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,12 @@ "php": ">=5.3.10" }, "require-dev": { - "codeception/codeception": "^2.2", - "joomla-projects/joomla-browser": "v3.6.5.1", + "codeception/codeception": "~2.3", + "joomla-projects/joomla-browser": "~v3", + "joomla-projects/selenium-server-standalone": "~v3", "consolidation/robo": "^1.0.0", - "joomla-projects/robo": "~0", - "joomla-projects/selenium-server-standalone": "v3.1.0", + "joomla-projects/joomla-testing-robo": "^1.0.0", "fzaninotto/faker": "^1.6", - "joomla-projects/jorobo": "~0.6", - "Behat/Gherkin": "^4.4.1" + "joomla-projects/jorobo": "~0.6" } } diff --git a/composer.lock b/composer.lock index 665b164..0c68bc7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "b8d54335b03ccb86dc3697d1ce8f11d4", + "content-hash": "eaf5e5dfb6cdd2669e19e9c9ff965c70", "packages": [], "packages-dev": [ { @@ -67,29 +67,81 @@ "time": "2016-10-30T11:50:56+00:00" }, { - "name": "codeception/codeception", - "version": "2.2.11", + "name": "cloudinary/cloudinary_php", + "version": "1.8.0", "source": { "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080" + "url": "https://github.com/cloudinary/cloudinary_php.git", + "reference": "641b0901ca616c540b773abb802987a502aa8b89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/a8681b416921ae282ccca2c485d75a3ed6756080", - "reference": "a8681b416921ae282ccca2c485d75a3ed6756080", + "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/641b0901ca616c540b773abb802987a502aa8b89", + "reference": "641b0901ca616c540b773abb802987a502aa8b89", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "5.7.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ], + "files": [ + "src/Helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Cloudinary", + "homepage": "https://github.com/cloudinary/cloudinary_php/graphs/contributors" + } + ], + "description": "Cloudinary PHP SDK", + "homepage": "https://github.com/cloudinary/cloudinary_php", + "keywords": [ + "cdn", + "cloud", + "cloudinary", + "image management", + "sdk" + ], + "time": "2017-05-03T14:29:33+00:00" + }, + { + "name": "codeception/codeception", + "version": "2.3.5", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Codeception.git", + "reference": "e807cd458eb9f7ae7464f33ad835a2f54aa73194" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/e807cd458eb9f7ae7464f33ad835a2f54aa73194", + "reference": "e807cd458eb9f7ae7464f33ad835a2f54aa73194", "shasum": "" }, "require": { "behat/gherkin": "~4.4.0", "ext-json": "*", "ext-mbstring": "*", - "facebook/webdriver": ">=1.0.1 <2.0", + "facebook/webdriver": ">=1.1.3 <2.0", "guzzlehttp/guzzle": ">=4.1.4 <7.0", "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0 <8.0", "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">4.8.20 <6.0", + "phpunit/phpunit": ">4.8.20 <7.0", "phpunit/phpunit-mock-objects": ">2.3 <5.0", "sebastian/comparator": ">1.1 <3.0", "sebastian/diff": "^1.4", @@ -114,6 +166,7 @@ "php-amqplib/php-amqplib": "~2.4", "predis/predis": "^1.0", "squizlabs/php_codesniffer": "~2.0", + "symfony/process": ">=2.7 <4.0", "vlucas/phpdotenv": "^2.4.0" }, "suggest": { @@ -158,7 +211,7 @@ "functional testing", "unit testing" ], - "time": "2017-05-11T21:07:05+00:00" + "time": "2017-08-10T20:28:02+00:00" }, { "name": "composer/ca-bundle", @@ -221,20 +274,20 @@ }, { "name": "consolidation/annotated-command", - "version": "2.4.8", + "version": "2.4.11", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e" + "reference": "7fbf68dc6abf2f1f0746ceab0701dee1ee97516e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/6672ea38212f8bffb71fec7eadc8b3372154b17e", - "reference": "6672ea38212f8bffb71fec7eadc8b3372154b17e", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/7fbf68dc6abf2f1f0746ceab0701dee1ee97516e", + "reference": "7fbf68dc6abf2f1f0746ceab0701dee1ee97516e", "shasum": "" }, "require": { - "consolidation/output-formatters": "^3.1.5", + "consolidation/output-formatters": "^3.1.10", "php": ">=5.4.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", "psr/log": "^1", @@ -269,7 +322,56 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-04-03T22:37:00+00:00" + "time": "2017-07-27T20:29:17+00:00" + }, + { + "name": "consolidation/config", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/config.git", + "reference": "e3c7311f8926488fe2fbce0ec6af56be417da504" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/config/zipball/e3c7311f8926488fe2fbce0ec6af56be417da504", + "reference": "e3c7311f8926488fe2fbce0ec6af56be417da504", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "grasmash/yaml-expander": "^1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Provide configuration services for a commandline tool.", + "time": "2017-07-28T18:05:53+00:00" }, { "name": "consolidation/log", @@ -320,16 +422,16 @@ }, { "name": "consolidation/output-formatters", - "version": "3.1.9", + "version": "3.1.10", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "2e09069866bae89d3fb545365f997a40745e34d2" + "reference": "3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/2e09069866bae89d3fb545365f997a40745e34d2", - "reference": "2e09069866bae89d3fb545365f997a40745e34d2", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a", + "reference": "3872f19517bfc9da0e14c9e5b6fe0f8c7439ea3a", "shasum": "" }, "require": { @@ -365,24 +467,25 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-05-08T15:59:33+00:00" + "time": "2017-06-06T19:08:54+00:00" }, { "name": "consolidation/robo", - "version": "1.0.5", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "d06450370e8e303ebd1495dfc956f4c6c1b9dd01" + "reference": "46340c0ba2477e6f30a22ebaa072da0ba2b15bb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/d06450370e8e303ebd1495dfc956f4c6c1b9dd01", - "reference": "d06450370e8e303ebd1495dfc956f4c6c1b9dd01", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/46340c0ba2477e6f30a22ebaa072da0ba2b15bb1", + "reference": "46340c0ba2477e6f30a22ebaa072da0ba2b15bb1", "shasum": "" }, "require": { "consolidation/annotated-command": "^2.2", + "consolidation/config": "^1.0.1", "consolidation/log": "~1", "consolidation/output-formatters": "^3.1.5", "league/container": "^2.2", @@ -406,11 +509,11 @@ "pear/archive_tar": "^1.4.2", "phpunit/php-code-coverage": "~2|~4", "satooshi/php-coveralls": "~1", - "squizlabs/php_codesniffer": "~2" + "squizlabs/php_codesniffer": "^2.8" }, "suggest": { "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", - "natxet/CssMin": "For minifying JS files in taskMinify", + "natxet/CssMin": "For minifying CSS files in taskMinify", "patchwork/jsqueeze": "For minifying JS files in taskMinify", "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively." }, @@ -420,7 +523,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "1.x-dev", + "dev-state": "1.x-dev" } }, "autoload": { @@ -442,7 +546,7 @@ } ], "description": "Modern task runner", - "time": "2016-11-24T02:07:48+00:00" + "time": "2017-07-28T21:29:52+00:00" }, { "name": "container-interop/container-interop", @@ -475,6 +579,65 @@ "homepage": "https://github.com/container-interop/container-interop", "time": "2017-02-14T19:40:03+00:00" }, + { + "name": "dflydev/dot-access-data", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", + "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Dflydev\\DotAccessData": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "time": "2017-01-20T21:14:22+00:00" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -630,17 +793,157 @@ "time": "2016-04-29T12:21:54+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "6.2.3", + "name": "grasmash/yaml-expander", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "720c54b2c99b80d5d696714b6826183d34edce93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", - "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/720c54b2c99b80d5d696714b6826183d34edce93", + "reference": "720c54b2c99b80d5d696714b6826183d34edce93", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.5.4", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Grasmash\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-08-01T16:15:05+00:00" + }, + { + "name": "guzzle/guzzle", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": ">=2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "abandoned": "guzzlehttp/guzzle", + "time": "2014-01-28T22:29:15+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "shasum": "" }, "require": { @@ -650,9 +953,12 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", + "phpunit/phpunit": "^4.0 || ^5.0", "psr/log": "^1.0" }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, "type": "library", "extra": { "branch-alias": { @@ -689,7 +995,7 @@ "rest", "web service" ], - "time": "2017-02-28T22:50:30+00:00" + "time": "2017-06-22T18:50:49+00:00" }, { "name": "guzzlehttp/promises", @@ -851,16 +1157,16 @@ }, { "name": "joomla-projects/joomla-browser", - "version": "v3.6.5.1", + "version": "v3.7.4", "source": { "type": "git", "url": "https://github.com/joomla-projects/joomla-browser.git", - "reference": "833e113544dc05b34ef024b0634f17c69f95be42" + "reference": "2ba09f2d12cb4c2708101a5ffbcbb261a445cbc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/833e113544dc05b34ef024b0634f17c69f95be42", - "reference": "833e113544dc05b34ef024b0634f17c69f95be42", + "url": "https://api.github.com/repos/joomla-projects/joomla-browser/zipball/2ba09f2d12cb4c2708101a5ffbcbb261a445cbc1", + "reference": "2ba09f2d12cb4c2708101a5ffbcbb261a445cbc1", "shasum": "" }, "require": { @@ -886,7 +1192,7 @@ "email": "puneet.kala@community.joomla.org" }, { - "name": "Javier Gómez", + "name": "Javier Gomez", "email": "javier.gomez@community.joomla.org" } ], @@ -898,7 +1204,56 @@ "acceptance testing", "joomla" ], - "time": "2017-01-08T06:44:16+00:00" + "time": "2017-07-31T13:55:52+00:00" + }, + { + "name": "joomla-projects/joomla-testing-robo", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-projects/joomla-testing-robo.git", + "reference": "6d459ea7c3293b907e59429e077dea1367658f68" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-projects/joomla-testing-robo/zipball/6d459ea7c3293b907e59429e077dea1367658f68", + "reference": "6d459ea7c3293b907e59429e077dea1367658f68", + "shasum": "" + }, + "require": { + "cloudinary/cloudinary_php": "~1", + "consolidation/robo": "~1", + "knplabs/github-api": "~1", + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "~1" + }, + "replace": { + "joomla-projects/robo": "< 1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Joomla\\Testing\\Robo\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Tito Alvarez", + "email": "tito.alvarez@community.joomla.org" + } + ], + "description": "Joomla automated testing swiss knife", + "keywords": [ + "qa", + "robo", + "task", + "tests" + ], + "time": "2016-12-14T20:43:15+00:00" }, { "name": "joomla-projects/jorobo", @@ -950,66 +1305,29 @@ "description": "Tools and Tasks based on Robo.li for Joomla Extension Development and Releases", "time": "2017-03-15T23:28:44+00:00" }, - { - "name": "joomla-projects/robo", - "version": "0.1.0", - "source": { - "type": "git", - "url": "https://github.com/joomla-projects/robo.git", - "reference": "8a9c72f61696a4f288ede8212a0e7c7c47eda360" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/robo/zipball/8a9c72f61696a4f288ede8212a0e7c7c47eda360", - "reference": "8a9c72f61696a4f288ede8212a0e7c7c47eda360", - "shasum": "" - }, - "require": { - "squizlabs/php_codesniffer": "1.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "joomla_projects\\robo\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Javier", - "email": "javier.gomez@community.joomla.org" - } - ], - "description": "Robo tasks for Joomla Quality Assurance", - "keywords": [ - "BDD", - "robo", - "task" - ], - "abandoned": "joomla-projects/joomla-testing-robo", - "time": "2015-08-07T16:24:43+00:00" - }, { "name": "joomla-projects/selenium-server-standalone", - "version": "v3.1.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/joomla-projects/selenium-server-standalone.git", - "reference": "cc928a73f0dfb900793dec48b18e08e8dfcbbaa7" + "reference": "e2a7543d1d8e72de5da29f1b3fcf7653e9f0e0eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/cc928a73f0dfb900793dec48b18e08e8dfcbbaa7", - "reference": "cc928a73f0dfb900793dec48b18e08e8dfcbbaa7", + "url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/e2a7543d1d8e72de5da29f1b3fcf7653e9f0e0eb", + "reference": "e2a7543d1d8e72de5da29f1b3fcf7653e9f0e0eb", "shasum": "" }, "bin": [ "bin/selenium-server-standalone" ], "type": "library", + "autoload": { + "files": [ + "Selenium.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "Apache 2.0" @@ -1030,7 +1348,7 @@ "selenium", "testing" ], - "time": "2017-02-21T15:10:31+00:00" + "time": "2017-08-14T18:33:07+00:00" }, { "name": "joomla/compat", @@ -1371,6 +1689,68 @@ ], "time": "2016-12-10T17:09:33+00:00" }, + { + "name": "knplabs/github-api", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "98d0bcd2c4c96a40ded9081f8f6289907f73823c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/98d0bcd2c4c96a40ded9081f8f6289907f73823c", + "reference": "98d0bcd2c4c96a40ded9081f8f6289907f73823c", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "guzzle/guzzle": "~3.7", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "sllh/php-cs-fixer-styleci-bridge": "~1.3" + }, + "suggest": { + "knplabs/gaufrette": "Needed for optional Gaufrette cache" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Github\\": "lib/Github/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com", + "homepage": "http://ornicar.github.com" + }, + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + } + ], + "description": "GitHub API v3 client", + "homepage": "https://github.com/KnpLabs/php-github-api", + "keywords": [ + "api", + "gh", + "gist", + "github" + ], + "time": "2016-07-26T08:49:38+00:00" + }, { "name": "league/container", "version": "2.4.1", @@ -1492,22 +1872,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", "shasum": "" }, "require": { "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "phpdocumentor/type-resolver": "^0.3.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -1533,24 +1913,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-08-08T06:39:58+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -1580,7 +1960,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-06-03T08:32:36+00:00" }, { "name": "phpspec/prophecy", @@ -1895,16 +2275,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -1963,7 +2343,7 @@ "testing", "xunit" ], - "time": "2017-02-06T05:18:07+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2233,23 +2613,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -2281,7 +2661,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -2661,16 +3041,16 @@ }, { "name": "symfony/browser-kit", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57" + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/9fab1ab6f77b77f3df5fc5250fc6956811699b57", - "reference": "9fab1ab6f77b77f3df5fc5250fc6956811699b57", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", + "reference": "8079a6b3668ef15cdbf73a4c7d31081abb8bb5f0", "shasum": "" }, "require": { @@ -2687,7 +3067,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2714,20 +3094,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-07-12T13:03:20+00:00" }, { "name": "symfony/console", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38" + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", - "reference": "a7a17e0c6c3c4d70a211f80782e4b90ddadeaa38", + "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", "shasum": "" }, "require": { @@ -2735,10 +3115,16 @@ "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { @@ -2750,7 +3136,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2777,20 +3163,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-04-26T01:39:17+00:00" + "time": "2017-07-29T21:27:59+00:00" }, { "name": "symfony/css-selector", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc" + "reference": "4d882dced7b995d5274293039370148e291808f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", - "reference": "02983c144038e697c959e6b06ef6666de759ccbc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4d882dced7b995d5274293039370148e291808f2", + "reference": "4d882dced7b995d5274293039370148e291808f2", "shasum": "" }, "require": { @@ -2799,7 +3185,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2830,20 +3216,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-05-01T15:01:29+00:00" }, { "name": "symfony/debug", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686" + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/fd6eeee656a5a7b384d56f1072243fe1c0e81686", - "reference": "fd6eeee656a5a7b384d56f1072243fe1c0e81686", + "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", "shasum": "" }, "require": { @@ -2854,13 +3240,12 @@ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2887,20 +3272,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19T20:17:50+00:00" + "time": "2017-07-28T15:27:31+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" + "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", - "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", + "reference": "fc2c588ce376e9fe04a7b8c79e3ec62fe32d95b1", "shasum": "" }, "require": { @@ -2916,7 +3301,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -2943,29 +3328,32 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-05-25T23:10:31+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40" + "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", - "reference": "b8a401f733b43251e1d088c589368b2a94155e40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/67535f1e3fd662bdc68d7ba317c93eecd973617e", + "reference": "67535f1e3fd662bdc68d7ba317c93eecd973617e", "shasum": "" }, "require": { "php": ">=5.5.9" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", + "symfony/dependency-injection": "~3.3", "symfony/expression-language": "~2.8|~3.0", "symfony/stopwatch": "~2.8|~3.0" }, @@ -2976,7 +3364,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3003,20 +3391,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:58:48+00:00" + "time": "2017-06-09T14:53:08+00:00" }, { "name": "symfony/filesystem", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "040651db13cf061827a460cc10f6e36a445c45b4" + "reference": "427987eb4eed764c3b6e38d52a0f87989e010676" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/040651db13cf061827a460cc10f6e36a445c45b4", - "reference": "040651db13cf061827a460cc10f6e36a445c45b4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/427987eb4eed764c3b6e38d52a0f87989e010676", + "reference": "427987eb4eed764c3b6e38d52a0f87989e010676", "shasum": "" }, "require": { @@ -3025,7 +3413,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3052,20 +3440,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-07-11T07:17:58+00:00" }, { "name": "symfony/finder", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930" + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", - "reference": "9cf076f8f492f4b1ffac40aae9c2d287b4ca6930", + "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", "shasum": "" }, "require": { @@ -3074,7 +3462,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3101,20 +3489,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-06-01T21:01:25+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", "shasum": "" }, "require": { @@ -3126,7 +3514,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -3160,20 +3548,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-06-09T14:24:12+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67" + "reference": "94566239a7720cde0820f15f0cc348ddb51ba51d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/94566239a7720cde0820f15f0cc348ddb51ba51d", + "reference": "94566239a7720cde0820f15f0cc348ddb51ba51d", "shasum": "" }, "require": { @@ -3183,7 +3571,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -3216,20 +3604,20 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-06-09T08:25:21+00:00" }, { "name": "symfony/process", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0" + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", - "reference": "999c2cf5061e627e6cd551dc9ebf90dd1d11d9f0", + "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", "shasum": "" }, "require": { @@ -3238,7 +3626,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3265,20 +3653,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-04-12T14:13:17+00:00" + "time": "2017-07-13T13:05:09+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.8", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", - "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { @@ -3293,7 +3681,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -3320,7 +3708,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01T14:55:58+00:00" + "time": "2017-07-23T12:43:26+00:00" }, { "name": "webmozart/assert", diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 243f9c8..074505f 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -1,2 +1,3 @@ prefix = (isset($this->config['prefix'])) ? $this->config['prefix'] : ''; + + return parent::_initialize(); + } + + /** + * Inserts an SQL record into a database. This record will be + * erased after the test. + * + * @param string $table Table + * @param array $data Data + * + * @return integer The last insert id + * + * @since 3.7.3 + */ + public function haveInDatabase($table, array $data) + { + $table = $this->addPrefix($table); + + return parent::haveInDatabase($table, $data); + } + + /** + * Find an entry in the database + * + * @param string $table Table + * @param array $criteria Criteria + * + * @return mixed|false + * + * @since 3.7.3 + */ + public function findInDatabase($table, $criteria = []) + { + $table = $this->addPrefix($table); + + return parent::seeInDatabase($table, $criteria); + } + + /** + * Don't see in database + * + * @param string $table Table + * @param array $criteria Criteria + * + * @return mixed|false + * + * @since 3.7.3 + */ + public function dontSeeInDatabase($table, $criteria = []) + { + $table = $this->addPrefix($table); + + return parent::dontSeeInDatabase($table, $criteria); + } + + /** + * Grab an entry from the database + * + * @param string $table Table + * @param string $column Column + * @param array $criteria Criteria + * + * @return mixed + * + * @since 3.7.3 + */ + public function grabFromDatabase($table, $column, $criteria = null) + { + $table = $this->addPrefix($table); + + return parent::grabFromDatabase($table, $column, $criteria); + } + + /** + * Asserts that the given number of records were found in the database. + * + * @param int $expectedNumber Expected number + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + * + * @return mixed|bool + * + * @since 3.7.3 + */ + public function seeNumRecords($expectedNumber, $table, array $criteria = []) + { + $table = $this->addPrefix($table); + + return parent::seeNumRecords($expectedNumber, $table, $criteria); + } + + /** + * Returns the number of rows in a database + * + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + * + * @return int + * + * @since 3.7.3 + */ + public function grabNumRecords($table, array $criteria = []) + { + $table = $this->addPrefix($table); + + return parent::grabNumRecords($table, $criteria); + } + + /** + * Add the table prefix + * + * @param $table string Table without prefix + * + * @return string + * + * @since 3.7.3 + */ + protected function addPrefix($table) + { + return $this->prefix . $table; + } +} diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php new file mode 100644 index 0000000..89f9f1b --- /dev/null +++ b/tests/_support/Helper/Unit.php @@ -0,0 +1,23 @@ + 'system-message-container']; + + /** + * The element id which contains page title in administrator header. + * + * @var array + * @since 3.7.3 + */ + public static $pageTitle = ['class' => 'page-title']; + + /** + * Locator for page title + * + * @var array + * @since 3.7.3 + */ + public static $title = ['id' => 'jform_title']; + + /** + * Locator for search input field + * + * @var array + * @since 3.7.3 + */ + public static $filterSearch = ['id' => 'filter_search']; + + /** + * Locator for status filter under search tool + * + * @var array + * @since 3.7.3 + */ + public static $filterPublished = 'filter_published'; + + /** + * Locator for search button icon + * + * @var array + * @since 3.7.3 + */ + public static $iconSearch = ['class' => 'icon-search']; + + /** + * Locator for the Tabs in Edit View + * + * @var array + * @since 3.7.3 + */ + public static $tabsLocator = ['xpath' => "//ul[@id='myTabTabs']/li/a"]; + + /** + * Locator for the Check All checkbox + * + * @var array + * @since 3.7.3 + */ + public static $checkAll = ['xpath' => "//thead//input[@name='checkall-toggle' or @name='toggle']"]; + + /** + * Method to search using given keyword + * + * @param string $keyword The keyword to search + * + * @since 3.7.3 + * + * @return void + */ + public function search($keyword) + { + $I = $this; + + $I->amGoingTo('search for "' . $keyword . '"'); + $I->fillField(static::$filterSearch, $keyword); + $I->click(static::$iconSearch); + } + + /** + * Method to search user with username + * + * @param string $keyword The username of user + * + * @since 3.7.3 + * + * @return void Checkbox for given username will be checked. + */ + public function haveItemUsingSearch($keyword) + { + $I = $this; + + $I->amOnPage(static::$url); + $I->search($keyword); + $I->checkAllResults(); + $I->wait(1); + } + + /** + * Method is used to see system message after waiting for page title. + * + * @param string $title The webpage title + * @param string $message The unpublish successful message + * + * @since 3.7.3 + * + * @return void + */ + public function seeSystemMessage($title, $message) + { + $I = $this; + + $I->waitForPageTitle($title); + $I->see($message, self::$systemMessageContainer); + } + + /** + * Method is to Wait for page title until default timeout. + * + * @param string $title Page Title text + * + * @since 3.7.3 + * + * @return void + */ + public function waitForPageTitle($title) + { + $I = $this; + $I->waitForText($title, TIMEOUT, self::$pageTitle); + } + + /** + * Function to select Toolbar buttons in Joomla! Admin Toolbar Panel + * + * @param string $button The full name of the button + * + * @since 3.7.3 + * + * @return void + */ + public function clickToolbarButton($button) + { + $I = $this; + $input = strtolower($button); + + $suiteConfiguration = $I->getSuiteConfiguration(); + $screenWidth = explode("x", $suiteConfiguration['modules']['config']['JoomlaBrowser']['window_size']); + + if ($screenWidth[0] <= 480) + { + $I->click('Toolbar'); + } + + switch ($input) + { + case "new": + $I->click(['xpath' => "//div[@id='toolbar-new']//button"]); + break; + case "edit": + $I->click(['xpath' => "//div[@id='toolbar-edit']//button"]); + break; + case "publish": + $I->click(['xpath' => "//div[@id='toolbar-publish']//button"]); + break; + case "unpublish": + $I->click(['xpath' => "//div[@id='toolbar-unpublish']//button"]); + break; + case "archive": + $I->click(['xpath' => "//div[@id='toolbar-archive']//button"]); + break; + case "check-in": + $I->click(['xpath' => "//div[@id='toolbar-checkin']//button"]); + break; + case "batch": + $I->click(['xpath' => "//div[@id='toolbar-batch']//button"]); + break; + case "rebuild": + $I->click(['xpath' => "//div[@id='toolbar-refresh']//button"]); + break; + case "trash": + $I->click(['xpath' => "//div[@id='toolbar-trash']//button"]); + break; + case "save": + $I->click(['xpath' => "//div[@id='toolbar-apply']//button"]); + break; + case "save & close": + $I->click(['xpath' => "//div[@id='toolbar-save']//button"]); + break; + case "save & new": + $I->click(['xpath' => "//div[@id='toolbar-save-new']//button"]); + break; + case "cancel": + $I->click(['xpath' => "//div[@id='toolbar-cancel']//button"]); + break; + case "options": + $I->click(['xpath' => "//div[@id='toolbar-options']//button"]); + break; + case "empty trash": + case "delete": + $I->click(['xpath' => "//div[@id='toolbar-delete']//button"]); + break; + case "unblock": + $I->click(['xpath' => "//div[@id='toolbar-unblock']//button"]); + break; + case "featured": + $I->click(['xpath' => "//div[@id='toolbar-featured']//button"]); + break; + } + } + + /** + * Function to select all the item in the Search results in Administrator List + * + * Note: We recommend use of checkAllResults function only after searchForItem to be sure you are selecting only the desired result set + * + * @since 3.7.3 + * + * @return void + */ + public function checkAllResults() + { + $I = $this; + + $I->comment("Selecting Checkall button"); + $I->click(self::$checkAll); + } + + /** + * Selects an option in a Chosen Selector based on its id + * + * @param string $selectId The id of the