PK ,?V#8v codeceptnu W+A #!/usr/bin/env php add(new Codeception\Command\Build('build')); $app->add(new Codeception\Command\Run('run')); $app->add(new Codeception\Command\Console('console')); $app->add(new Codeception\Command\Bootstrap('bootstrap')); $app->add(new Codeception\Command\GenerateCept('generate:cept')); $app->add(new Codeception\Command\GenerateCest('generate:cest')); $app->add(new Codeception\Command\GenerateTest('generate:test')); $app->add(new Codeception\Command\GeneratePhpUnit('generate:phpunit')); $app->add(new Codeception\Command\GenerateSuite('generate:suite')); $app->add(new Codeception\Command\GenerateHelper('generate:helper')); $app->add(new Codeception\Command\GenerateScenarios('generate:scenarios')); $app->add(new Codeception\Command\Clean('clean')); $app->add(new Codeception\Command\GenerateGroup('generate:groupobject')); $app->add(new Codeception\Command\GeneratePageObject('generate:pageobject')); $app->add(new Codeception\Command\GenerateStepObject('generate:stepobject')); $app->add(new Codeception\Command\GenerateEnvironment('generate:environment')); $app->add(new Codeception\Command\GenerateFeature('generate:feature')); $app->add(new Codeception\Command\GherkinSnippets('gherkin:snippets')); $app->add(new Codeception\Command\GherkinSteps('gherkin:steps')); $app->add(new Codeception\Command\DryRun('dry-run')); $app->registerCustomCommands(); $app->run(); PK ,?VnoTWN N LICENSEnu W+A The MIT License (MIT) Copyright (c) 2011 Michael Bodnarchuk and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK ,?V"3 3 appveyor.ymlnu W+A build: false shallow_clone: true platform: 'x86' branches: except: - gh-pages cache: - c:\tools\php -> appveyor.yml services: - mysql - postgresql93 - mongodb init: - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% - SET COMPOSER_NO_INTERACTION=1 - SET PHP=1 - SET ANSICON=121x90 (121x90) install: # databases setup - SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH% - SET PGUSER=postgres - SET PGPASSWORD=Password12! - SET PATH=C:\Program Files\PostgreSQL\9.3\bin\;%PATH% # php setup - IF EXIST c:\tools\php (SET PHP=0) - IF %PHP%==1 cinst -y OpenSSL.Light - SET PATH=C:\Program Files\OpenSSL;%PATH% - cinst -y curl - SET PATH=C:\Program Files\curl;%PATH% - IF %PHP%==1 cinst -y php - IF %PHP%==1 cd c:\tools\php - IF %PHP%==1 cd ext - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/mongodb/1.1.6/php_mongodb-1.1.6-7.0-nts-vc14-x64.zip - IF %PHP%==1 7z x php_mongodb-1.1.6-7.0-nts-vc14-x64.zip -y >nul - IF %PHP%==1 cd .. - IF %PHP%==1 copy php.ini-production php.ini - IF %PHP%==1 echo extension_dir=ext >> php.ini - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini - IF %PHP%==1 echo date.timezone="UTC" >> php.ini - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini - IF %PHP%==1 echo extension=php_curl.dll >> php.ini - IF %PHP%==1 echo extension=php_pdo_mysql.dll >> php.ini - IF %PHP%==1 echo extension=php_pdo_pgsql.dll >> php.ini - IF %PHP%==1 echo extension=php_pdo_sqlite.dll >> php.ini - IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini - IF %PHP%==1 echo extension=php_mongodb.dll >> php.ini - SET PATH=C:\tools\php;%PATH% - cd %APPVEYOR_BUILD_FOLDER% - appveyor DownloadFile https://getcomposer.org/composer.phar - php composer.phar install --prefer-dist -n --no-ansi before_test: - createdb codeception_test - mysql -uroot -pPassword12! -e "CREATE DATABASE codeception_test" test_script: - php codecept run cli --no-colors -n --skip-group coverage - php codecept run unit -g core -g appveyor --no-colors -n PK ,?V|0gb b CONTRIBUTING.mdnu W+A # How to contribute At Codeception we are glad to receive contributions and patches from the community. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. Please check the guide for sending your contributions with Github at https://github.com/Codeception/Codeception/wiki/Git-workflow-for-Codeception-contributors ## Coding Standards All contributions must follow [PSR-2](http://www.php-fig.org/psr/psr-2/) coding standard. ## Code **Bugfixes should be sent to to current stable branch, which is the same as major version number.** Breaking features and major improvements should be sent into `master`. When you send PRs to master, they will be added to release cycle only when the next stable branch is started. ## Tests Check the [tests/README.md](tests/README.md) to learn how to run and write internal tests. We encourage you to write a test for a patch you are implementing. If this doesn't seem possible, such PRs are stil valid and can be accepted. We also encourage to submit bug reports with a failing test or test environment (3rd party repo with Codeception installation) with demonstration of a failure. That makes easier to us to find the cause and fix it. ## Documentation ### Guides If you want to contribute documentation to the guides you are asked to send your changes to the /docs/ folder: https://github.com/Codeception/Codeception/tree/2.0/docs. This files are the source for the codeception website guides: http://codeception.com/docs/01-Introduction. Remind to send your documentation improvements to the right "repository branch" depending on the Codeception version you are working with: 2.0, master,... ### Modules Documentation The documentation for each module is directly generated from the corresponding docblock which can be found in each module (src/Module/Codeception/*.php). PK ,?VnB ISSUE_TEMPLATE.mdnu W+A #### What are you trying to achieve? #### What do you get instead? > Provide console output if related. Use `-vvv` mode for more details. ```bash # paste output here ``` > Provide test source code if related ```php // paste test ``` ### Details * Codeception version: * PHP Version: * Operating System: * Installation type: Phar || Composer * List of installed packages (`composer show`) * Suite configuration: ```yml # paste suite config here ``` PK ,?Vmsxa' a' .travis.ymlnu W+A language: php php: - 7.0 - hhvm matrix: allow_failures: - php: hhvm # because we haven't fixed all issues yet include: - php: 5.4 # lowest versions of all dependencies env: PHALCON=2.1.x SYMFONY=2.7.0 SYMFONY_DEPRECATIONS_HELPER=weak # latest version of 2.7.* - php: 5.5 env: dependencies=lowest SYMFONY_DEPRECATIONS_HELPER=weak - php: 5.6 env: SYMFONY=2.8.0 SYMFONY_DEPRECATIONS_HELPER=weak # latest version of 2.8.* addons: postgresql: "9.2" branches: except: - gh-pages cache: directories: - vendor - $HOME/.composer/cache services: - mongodb - rabbitmq - postgresql - redis sudo: false install: - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || pecl install mongodb' #- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini # use hhvm-serve instead of builtin server - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || mkdir -p /home/travis/go/{src,bin,pkg}' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || export GOPATH="/home/travis/go"' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || export PATH="$GOPATH/bin:$PATH"' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || go get github.com/Naktibalda/hhvm-serve' - composer self-update && composer --version - if [ -n "$CI_USER_TOKEN" ]; then composer config github-oauth.github.com ${CI_USER_TOKEN}; echo "Configured Github token"; fi; - composer global require "fxp/composer-asset-plugin:~1.1.1" - '[[ -z "$SYMFONY" ]] || composer require symfony/finder=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/yaml=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/console=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/event-dispatcher=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/css-selector=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/dom-crawler=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ -z "$SYMFONY" ]] || composer require symfony/browser-kit=~$SYMFONY --no-update --ignore-platform-reqs' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || composer remove mongodb/mongodb --no-update --dev' - composer_parameters="-n --prefer-dist" # this variable will be used in all composer install commands - '[[ "$dependencies" != "lowest" ]] || composer_parameters="$composer_parameters --prefer-lowest"' - composer update $composer_parameters - composer_parameters="$composer_parameters --no-dev" # Codeception needs dev dependencies, but frameworks don't # Yii2 - composer create-project "yiisoft/yii2-app-basic:@dev" frameworks-yii-basic --no-dev # Phalcon - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || [[ -z "$PHALCON" ]] || git clone -q --depth=1 https://github.com/phalcon/cphalcon.git -b $PHALCON' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || [[ ! -z "$PHALCON" ]] || git clone -q --depth=1 https://github.com/phalcon/cphalcon.git' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || (cd cphalcon/build; bash install &>/dev/null && phpenv config-add ../tests/_ci/phalcon.ini &> /dev/null && cd ../..;)' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || git clone -q --depth=1 https://github.com/Codeception/phalcon-demo.git frameworks-phalcon' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || composer update -d frameworks-phalcon $composer_parameters' # Laravel 5 - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || git clone -q -b codeception-2.2 https://github.com/janhenkgerritsen/codeception-laravel5-sample.git frameworks-l5' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || composer update -d frameworks-l5 $composer_parameters' # Lumen - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || git clone -q -b codeception-2.2 https://github.com/janhenkgerritsen/codeception-lumen-sample.git frameworks-lumen' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || composer update -d frameworks-lumen $composer_parameters' # Symfony - git clone -q -b 2.1 https://github.com/Codeception/symfony-demo.git frameworks-symfony - '[[ -z "$SYMFONY" ]] || composer require -d frameworks-symfony symfony/symfony=~$SYMFONY --no-update' - '[[ -z "$SYMFONY" ]] || composer update -d frameworks-symfony $composer_parameters' # ZF1 - git clone -q -b 2.2-simple-file-upload --recursive https://github.com/Naktibalda/codeception-zf1-tests frameworks-zf1 - composer update -d frameworks-zf1 $composer_parameters # ZF2 - git clone -q -b 2.2 --recursive https://github.com/Naktibalda/codeception-zf2-tests frameworks-zf2 - composer update -d frameworks-zf2 $composer_parameters # Zend Expressive - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || git clone -q -b 2.2 --recursive https://github.com/Naktibalda/codeception-zend-expressive-tests frameworks-zend-expressive' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || composer update -d frameworks-zend-expressive $composer_parameters' before_script: - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || [[ "$TRAVIS_PHP_VERSION" == "7.0" ]] || echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini' # create config file for hhvm daemon - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "pid = /tmp/hhvm.pid" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.port = 9000" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.type = fastcgi" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.default_document = index.php" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.log.use_log_file = true" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.log.file = /tmp/hhvm-error.log" >>/tmp/hhvm.ini' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.repo.central.path = /tmp/hhvm.hhbc" >>/tmp/hhvm.ini' # start hhvm daemon - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm --config "/tmp/hhvm.ini" --mode daemon' # preparing databases - "mysql -e 'create database codeception_test;'" - psql -c 'create database codeception_test;' -U postgres # starting demo servers - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php -S 127.0.0.1:8010 -t tests/data >/dev/null 2>&1 &' # use hhvm-serve instead of builtin server - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm-serve --document-root=tests/data/app --listen=127.0.0.1:8000 >/dev/null 2>&1 &' - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm-serve --document-root=tests/data --listen=127.0.0.1:8010 >/dev/null 2>&1 &' # Phalcon - mysql -e 'CREATE DATABASE phalcon_demo CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;' - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || cat frameworks-phalcon/schemas/phalcon_demo.sql | mysql phalcon_demo' # Laravel 5 - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || touch frameworks-l5/storage/testing.sqlite' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php frameworks-l5/artisan migrate --database=sqlite_testing --force' # Lumen - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || cp frameworks-lumen/.env.testing frameworks-lumen/.env' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || touch frameworks-lumen/storage/testing.sqlite' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php frameworks-lumen/artisan migrate --database=testing --force' # Symfony - '[[ -z "$SYMFONY" ]] || php frameworks-symfony/app/console doctrine:schema:create -n --env test' - '[[ -z "$SYMFONY" ]] || php frameworks-symfony/app/console doctrine:fixtures:load -n --env test' # ZF2 - "mysql -e 'create database zf2_test;'" - php frameworks-zf2/vendor/bin/doctrine-module orm:schema-tool:create # Build - php codecept build -c frameworks-yii-basic - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept build -c frameworks-phalcon' - '[[ -z "$SYMFONY" ]] || php codecept build -c frameworks-symfony/src/AppBundle' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php codecept build -c frameworks-l5' - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php codecept build -c frameworks-lumen' - php codecept build -c frameworks-zf1 - php codecept build -c frameworks-zf2 - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || php codecept build -c frameworks-zend-expressive' script: # enable xdebug before running codeception tests on hhvm - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "xdebug.enable = On" >> /etc/hhvm/php.ini' - php codecept run cli,unit # self tests - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept run coverage' # run coverage tests on php only # disable xdebug before running framework tests - '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "xdebug.enable = Off" >> /etc/hhvm/php.ini' - php codecept run functional -c frameworks-yii-basic # Yii2 tests - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php codecept run -c frameworks-l5' # Laravel5 Tests - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.5" ]] || php codecept run -c frameworks-lumen' # Lumen Tests - '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept run functional -c frameworks-phalcon' # Phalcon Tests - '[[ -z "$SYMFONY" ]] || php codecept run functional -c frameworks-symfony/src/AppBundle '# Symfony Tests - php codecept run functional -c frameworks-zf1 # ZF1 Tests - php codecept run -c frameworks-zf2 functional,doctrine # ZF2 Tests - '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || php codecept run functional -c frameworks-zend-expressive' # Zend Expressive Tests PK ,?VC W W nitpick.jsonnu W+A { "ignore": [ "tests/*", "RoboFile.php", "shim.php" ] }PK ,?V codeception.ymlnu W+A paths: tests: tests log: tests/log data: tests/data support: tests/support envs: tests/envs settings: shuffle: true bootstrap: _bootstrap.php suite_class: \PHPUnit_Framework_TestSuite colors: true memory_limit: 1024M log: true lint: true modules: config: AMQP: host: 'localhost' port: '5672' username: 'guest' password: 'guest' vhost: '/' queues: [queue1, queue2] extensions: enabled: [Codeception\Extension\RunFailed] coverage: enabled: true include: - src/Codeception/Command/* - src/Codeception/Module/Symfony1.php - src/Codeception/Module/Symfony2.php - src/Codeception/Module/Doctrine1.php - src/Codeception/Module/Doctrine2.php - src/Codeception/Module/Kohana.php - src/Codeception/Module/SocialEngine.php - src/Codeception/Module/ZF1.phpPK ,?VKt t RoboFile.phpnu W+A say("CODECEPTION RELEASE: ".\Codeception\Codecept::VERSION); $this->update(); $this->buildDocs(); $this->publishDocs(); $this->buildPhar54(); $this->buildPhar(); $this->revertComposerJsonChanges(); $this->publishPhar(); $this->publishGit(); $this->publishBase(null, \Codeception\Codecept::VERSION); $this->versionBump(); } public function versionBump($version = '') { if (!$version) { $versionParts = explode('.', \Codeception\Codecept::VERSION); $versionParts[count($versionParts)-1]++; $version = implode('.', $versionParts); } $this->say("Bumping version to $version"); $this->taskReplaceInFile('src/Codeception/Codecept.php') ->from(\Codeception\Codecept::VERSION) ->to($version) ->run(); } public function update() { $this->clean(); $this->taskComposerUpdate()->dir('tests/data/claypit')->run(); $this->taskComposerUpdate()->run(); } public function changed($change) { $this->taskChangelog() ->version(\Codeception\Codecept::VERSION) ->change($change) ->run(); } protected function server() { $this->taskServer(8000) ->background() ->dir('tests/data/app') ->run(); } public function testPhpbrowser($args = '', $opt = ['test|t' => null]) { $test = $opt['test'] ? ':'.$opt['test'] : ''; $this->server(); $this->taskCodecept('./codecept') ->args($args) ->test('tests/unit/Codeception/Module/PhpBrowserTest.php'.$test) ->run(); } public function testRestBrowser($args = '', $opt = ['test|t' => null]) { $test = $opt['test'] ? ':'.$opt['test'] : ''; $this->taskServer(8010) ->background() ->dir('tests/data') ->run(); $this->taskCodecept('./codecept') ->test('tests/unit/Codeception/Module/PhpBrowserRestTest.php'.$test) ->args($args) ->run(); } public function testCoverage() { $this->server(); $this->taskSymfonyCommand(new \Codeception\Command\Run('run')) ->arg('suite', 'coverage') ->run(); } public function testWebdriver($args = '', $opt = ['test|t' => null]) { $test = $opt['test'] ? ':'.$opt['test'] : ''; $container = $this->taskDockerRun('davert/selenium-env') ->detached() ->publish(4444, 4444) ->env('APP_PORT', 8000) ->run(); $this->taskServer(8000) ->dir('tests/data/app') ->background() ->host('0.0.0.0') ->run(); sleep(3); // wait for selenium to launch $this->taskCodecept('./codecept') ->test('tests/web/WebDriverTest.php'.$test) ->args($args) ->run(); $this->taskDockerStop($container)->run(); } public function testLaunchServer($pathToSelenium = '~/selenium-server.jar ') { $this->taskExec('java -jar '.$pathToSelenium) ->background() ->run(); $this->taskServer(8010) ->background() ->dir('tests/data/rest') ->run(); $this->taskServer(8000) ->dir('tests/data/app') ->run(); } public function testCli() { $this->taskSymfonyCommand(new \Codeception\Command\Run('run')) ->arg('suite', 'cli') ->run(); $this->taskSymfonyCommand(new \Codeception\Command\Run('run')) ->arg('suite', 'tests/unit/Codeception/Command') ->run(); } private function installDependenciesForPhp54() { $this->taskReplaceInFile('composer.json') ->regex('/"platform": \{.*?\}/') ->to('"platform": {"php": "5.4.0"}') ->run(); $this->taskComposerUpdate()->run(); } private function installDependenciesForPhp56() { $this->taskReplaceInFile('composer.json') ->regex('/"platform": \{.*?\}/') ->to('"platform": {"php": "5.6.0"}') ->run(); $this->taskComposerUpdate()->run(); } private function revertComposerJsonChanges() { $this->taskReplaceInFile('composer.json') ->regex('/"platform": \{.*?\}/') ->to('"platform": {}') ->run(); } /** * @desc creates codecept.phar * @throws Exception */ public function buildPhar() { $this->packPhar('package/codecept.phar'); } /** * @desc creates codecept.phar with Guzzle 5.3 and Symfony 2.8 * @throws Exception */ public function buildPhar54() { if (!file_exists('package/php54')) { mkdir('package/php54'); } $this->installDependenciesForPhp54(); $this->packPhar('package/php54/codecept.phar'); $this->installDependenciesForPhp56(); } private function packPhar($pharFileName) { $pharTask = $this->taskPackPhar($pharFileName) ->compress() ->stub('package/stub.php'); $finder = Finder::create() ->ignoreVCS(true) ->name('*.php') ->name('*.tpl.dist') ->name('*.html.dist') ->in('src'); foreach ($finder as $file) { $pharTask->addFile('src/'.$file->getRelativePathname(), $file->getRealPath()); } $finder = Finder::create() ->ignoreVCS(true) ->name('*.php') ->in('ext'); foreach ($finder as $file) { $pharTask->addFile('ext/'.$file->getRelativePathname(), $file->getRealPath()); } $finder = Finder::create()->files() ->ignoreVCS(true) ->name('*.php') ->name('*.css') ->name('*.png') ->name('*.js') ->name('*.css') ->name('*.eot') ->name('*.svg') ->name('*.ttf') ->name('*.wof') ->name('*.woff') ->name('*.woff2') ->name('*.png') ->name('*.tpl.dist') ->name('*.html.dist') ->exclude('videlalvaro') ->exclude('php-amqplib') ->exclude('pheanstalk') ->exclude('phpseclib') ->exclude('codegyre') ->exclude('monolog') ->exclude('phpspec') ->exclude('squizlabs') ->exclude('Tests') ->exclude('tests') ->exclude('benchmark') ->exclude('demo') ->in('vendor'); foreach ($finder as $file) { $pharTask->addStripped('vendor/'.$file->getRelativePathname(), $file->getRealPath()); } $pharTask->addFile('autoload.php', 'autoload.php') ->addFile('codecept', 'package/bin') ->addFile('shim.php', 'shim.php') ->run(); $code = $this->taskExec('php ' . $pharFileName)->run()->getExitCode(); if ($code !== 0) { throw new Exception("There was problem compiling phar"); } } /** * @desc generates modules reference from source files */ public function buildDocs() { $this->say('generating documentation from source files'); $this->buildDocsModules(); $this->buildDocsUtils(); $this->buildDocsCommands(); $this->buildDocsExtensions(); } public function buildDocsModules() { $this->taskCleanDir('docs/modules')->run(); $this->say("Modules"); $modules = Finder::create()->files()->name('*.php')->in(__DIR__ . '/src/Codeception/Module'); foreach ($modules as $module) { $moduleName = basename(substr($module, 0, -4)); $className = 'Codeception\Module\\' . $moduleName; $source = "https://github.com/Codeception/Codeception/tree/" .self::STABLE_BRANCH."/src/Codeception/Module/$moduleName.php"; $this->taskGenDoc('docs/modules/' . $moduleName . '.md') ->docClass($className) ->prepend('# '.$moduleName) ->append('
[+] (Codeception\Command\GenerateCestCest.php:Codeception\Command\GenerateCest._before) (0.01s) |
||||||||
|
||||||||
[+] test method Codeception\Command\GenerateCest.execute() (Codeception\Command\GenerateCestCest.php:Codeception\Command\GenerateCest.execute) (0.01s) |
||||||||
|
||||||||
[+] run steps from scenario (Codeception\ScenarioCest.php:\Codeception\Scenario.run) (0.16s) |
||||||||
|
||||||||
[+] (SimpleWithNoClassCest.php:PhpTestCest::phpFuncitons) (0s) |
||||||||
|
||||||||
[+] try writing shoulds (SimpleWithNoClassCest.php:PhpTestCest::shouldTryWritingShoulds) (0s) |
||||||||
|
||||||||
[+] CodeceptTest::testLatestVersion (0s) |
||||||||
|
||||||||
[+] ConfigurationTest::testModules (0s) |
||||||||
|
||||||||
[+] ConfigurationTest::testActions (0s) |
||||||||
|
||||||||
[+] FrameworksTest::testAmOnPage (0.02s) |
||||||||
|
||||||||
[+] FrameworksTest::testSee (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeInCurrentUrl (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeLink (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testClick (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testCheckboxByCss (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testChecxboxByLabel (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSelectByCss (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSelectByLabel (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSelectByLabelAndOptionText (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testHidden (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testTextareaByCss (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testTextareaByLabel (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testTextFieldByCss (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testTextFieldByLabel (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testFileFieldByCss (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testFileFieldByLabel (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeCheckboxIsNotChecked (0s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeCheckboxChecked (0s) |
||||||||
|
||||||||
[+] FrameworksTest::testSubmitForm (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSubmitFormWithNoSubmitButton (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSubmitFormByButton (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testAjax (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeWithNonLatin (0s) |
||||||||
|
||||||||
[+] FrameworksTest::testSeeWithNonLatinAndSelectors (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testLinksWithNonLatin (0.01s) |
||||||||
|
||||||||
[+] FrameworksTest::testFieldWithNonLatin (0s) |
||||||||
|
||||||||
[+] FrameworksTest::testComplexSelectorsAndForms (0.01s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSubmitForm (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testAjax (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testAmOnPage (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSee (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeInCurrentUrl (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeLink (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testClick (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testCheckboxByCss (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testChecxboxByLabel (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSelectByCss (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSelectByLabel (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSelectByLabelAndOptionText (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testHidden (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testTextareaByCss (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testTextareaByLabel (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testTextFieldByCss (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testTextFieldByLabel (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testFileFieldByCss (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testFileFieldByLabel (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeCheckboxIsNotChecked (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeCheckboxChecked (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeWithNonLatin (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testSeeWithNonLatinAndSelectors (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testLinksWithNonLatin (0s) |
||||||||
|
||||||||
[+] PhpBrowserTest::testFieldWithNonLatin (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSelectByLabel (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testAmOnPage (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSee (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeInCurrentUrl (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeLink (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testClick (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testCheckboxByCss (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testChecxboxByLabel (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSelectByCss (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSelectByLabelAndOptionText (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testHidden (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testTextareaByCss (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testTextareaByLabel (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testTextFieldByCss (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testTextFieldByLabel (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testFileFieldByCss (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testFileFieldByLabel (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeCheckboxIsNotChecked (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeCheckboxChecked (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeWithNonLatin (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testSeeWithNonLatinAndSelectors (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testLinksWithNonLatin (0s) |
||||||||
|
||||||||
[+] SeleniumTest::testFieldWithNonLatin (0s) |
||||||||
|
||||||||
[+] UnitTest::testExecute (0.01s) |
||||||||
|
||||||||
[+] UnitTest::testStaticExecuteTestedMethod (0s) |
||||||||
|
||||||||
[+] UnitTest::testExecuteTestedMethod (0.01s) |
||||||||
|
||||||||
[+] UnitTest::testExecuteMethod (0s) |
||||||||
|
||||||||
[+] UnitTest::testSeeMethodResult (0s) |
||||||||
|
||||||||
[+] UnitTest::testMocks (0.01s) |
||||||||
|
||||||||
[+] UnitTest::testExceptions (0s) |
||||||||
|
||||||||
[+] SuiteManagerTest::testRun (0.04s) |
||||||||
|
||||||||
[+] SuiteManagerTest::testAddCest (0s) |
||||||||
|
||||||||
[+] SuiteManagerTest::testAddCept (0s) |
||||||||
|
||||||||
[+] SuiteManagerTest::testAddTest (0.01s) |
||||||||
|
||||||||
[+] TestCaseTest::testRunStepEvents (0s) |
||||||||
|
||||||||
[+] TestCaseTest::testRunFailedTestEvent (0.01s) |
||||||||
|
||||||||
[+] TestCaseTest::testRunStep (0s) |
||||||||
|
||||||||
[+] TestCaseTest::testRunStepAddsTrace (0s) |
||||||||
|
||||||||
[+] TestCaseTest::testSetUp (0s) |
||||||||
|
||||||||
[+] TestCaseTest::testTearDown (0s) |
||||||||
|
||||||||
[+] CeptTest::testTestCodecept (0s) |
||||||||
|
||||||||
[+] CestTest::testLoadScenario (0s) |
||||||||
|
||||||||
[+] MysqlTest::testCleanupDatabase (0.18s) |
||||||||
|
||||||||
[+] MysqlTest::testLoadDump (0.6s) |
||||||||
|
||||||||
[+] postgresTest::testCleanupDatabase (0.16s) |
||||||||
|
||||||||
[+] postgresTest::testLoadDump (0.37s) |
||||||||
|
||||||||
[+] SqliteTest::testCleanupDatabase (0.09s) |
||||||||
|
||||||||
[+] SqliteTest::testLoadDump (1.34s) |
||||||||
|
||||||||
[+] StubTest::testMakeEmpty (0.01s) |
||||||||
|
||||||||
[+] StubTest::testMakeEmptyMethodReplaced (0.01s) |
||||||||
|
||||||||
[+] StubTest::testMakeEmptyExcept (0.01s) |
||||||||
|
||||||||
[+] StubTest::testMakeEmptyExceptProperyRepalced (0.01s) |
||||||||
|
||||||||
[+] StubTest::testFactory (0s) |
||||||||
|
||||||||
[+] StubTest::testMake (0s) |
||||||||
|
||||||||
[+] StubTest::testCopy (0s) |
||||||||
|
||||||||
[+] StubTest::testConstruct (0s) |
||||||||
|
||||||||
[+] StubTest::testConstructEmpty (0s) |
||||||||
|
||||||||
[+] StubTest::testConstructEmptyExcept (0s) |
||||||||
|
||||||||
[+] StubTest::testUpdate (0s) |
||||||||
|
||||||||
Summary
|