Add support for old PHP versions on linux

This commit is contained in:
Shivam Mathur 2020-02-09 04:08:48 +05:30
parent 3c6644f237
commit ca33d01e9f
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
13 changed files with 893 additions and 100 deletions

View File

@ -31,7 +31,7 @@ describe('Extension tests', () => {
'7.4',
'linux'
);
expect(linux).toContain('update_extension xdebug 2.9.0');
expect(linux).toContain('update_extension xdebug 2.9.1');
expect(linux).toContain(
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-pcov'
);

View File

@ -46,7 +46,7 @@ jest.mock('../src/install', () => ({
case 'darwin':
case 'linux':
script = await install.build(os_version + '.sh', version, os_version);
script += 'sh script.sh ' + version + ' ' + __dirname;
script += 'bash script.sh ' + version + ' ' + __dirname;
break;
case 'win32':
script = await install.build(os_version + '.sh', version, os_version);
@ -117,7 +117,7 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('sh script.sh 7.3 ');
expect(script).toContain('bash script.sh 7.3 ');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', 'true');
// @ts-ignore
@ -126,7 +126,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('sh script.sh 7.3');
expect(script).toContain('bash script.sh 7.3');
expect(script).toContain('add_tool');
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit', '');
@ -136,7 +136,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('sh script.sh 7.3');
expect(script).toContain('bash script.sh 7.3');
expect(script).toContain('add_tool');
});
@ -145,7 +145,7 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('sh script.sh 7.3 ' + __dirname);
expect(script).toContain('bash script.sh 7.3 ' + __dirname);
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '', '');
// @ts-ignore
@ -154,7 +154,7 @@ describe('Install', () => {
expect(script).toContain('install extensions');
expect(script).toContain('edit php.ini');
expect(script).toContain('set coverage driver');
expect(script).toContain('sh script.sh 7.3 ' + __dirname);
expect(script).toContain('bash script.sh 7.3 ' + __dirname);
});
it('Test malformed version inputs', async () => {
@ -162,18 +162,18 @@ describe('Install', () => {
// @ts-ignore
let script: string = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('sh script.sh 7.4 ' + __dirname);
expect(script).toContain('bash script.sh 7.4 ' + __dirname);
setEnv(8.0, 'darwin', '', '', '', '', '');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('sh script.sh 8.0 ' + __dirname);
expect(script).toContain('bash script.sh 8.0 ' + __dirname);
setEnv(8, 'darwin', '', '', '', '', '');
// @ts-ignore
script = await install.run();
expect(script).toContain('initial script');
expect(script).toContain('sh script.sh 8.0 ' + __dirname);
expect(script).toContain('bash script.sh 8.0 ' + __dirname);
});
});

View File

@ -107,22 +107,13 @@ describe('Tools tests', () => {
});
it('checking getCodeceptionUriBuilder', async () => {
expect(await tools.getCodeceptionUriBuilder('3.2.1', '5.6', 'php56')).toBe(
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php56')).toBe(
'releases/3.2.1/php56/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.0', 'php54')).toBe(
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php54')).toBe(
'releases/3.2.1/php54/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.1', 'php56')).toBe(
'releases/3.2.1/php56/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.2', 'php56')).toBe(
'releases/3.2.1/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.3', 'php56')).toBe(
'releases/3.2.1/codecept.phar'
);
expect(await tools.getCodeceptionUriBuilder('3.2.1', '7.4', 'php56')).toBe(
expect(await tools.getCodeceptionUriBuilder('3.2.1', '')).toBe(
'releases/3.2.1/codecept.phar'
);
});
@ -146,17 +137,59 @@ describe('Tools tests', () => {
expect(await tools.getCodeceptionUri('latest', '7.4')).toBe(
'codecept.phar'
);
expect(await tools.getCodeceptionUri('3.2.1', '5.6')).toBe(
'releases/3.2.1/php54/codecept.phar'
expect(await tools.getCodeceptionUri('4.0.0', '7.4')).toBe(
'releases/4.0.0/codecept.phar'
);
expect(await tools.getCodeceptionUri('4.3.2', '5.6')).toBe(
'releases/4.3.2/php56/codecept.phar'
expect(await tools.getCodeceptionUri('4.0.0', '5.6')).toBe(
'releases/4.0.0/php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('3.2.1', '7.4')).toBe(
'releases/3.2.1/codecept.phar'
expect(await tools.getCodeceptionUri('4.0.0', '7.1')).toBe(
'releases/4.0.0/php56/codecept.phar'
);
expect(await tools.getCodeceptionUri('4.3.2', '7.4')).toBe(
'releases/4.3.2/codecept.phar'
expect(await tools.getCodeceptionUri('3.1.0', '7.4')).toBe(
'releases/3.1.0/codecept.phar'
);
expect(await tools.getCodeceptionUri('3.1.0', '5.6')).toBe(
'releases/3.1.0/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.5.4', '7.4')).toBe(
'releases/2.5.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.5.4', '5.6')).toBe(
'releases/2.5.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.3.4', '7.4')).toBe(
'releases/2.3.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.3.4', '5.4')).toBe(
'releases/2.3.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '5.6')).toBe(
'releases/2.2.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '7.4')).toBe(
'releases/2.2.4/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.2.4', '5.4')).toBe(
'releases/2.2.4/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.7', '5.6')).toBe(
'releases/2.1.7/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.7', '5.4')).toBe(
'releases/2.1.7/php54/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.5', '5.4')).toBe(
'releases/2.1.5/codecept.phar'
);
expect(await tools.getCodeceptionUri('2.1.5', '7.4')).toBe(
'releases/2.1.5/codecept.phar'
);
expect(await tools.getCodeceptionUri('1.6.9', '7.4')).toBe(
'releases/1.6.9/codecept.phar'
);
expect(await tools.getCodeceptionUri('1.5.0', '7.4')).toBe(
'releases/1.5.0/codecept.phar'
);
});

607
builds Normal file
View File

@ -0,0 +1,607 @@
<!doctype html>
<html lang="en">
<head>
<title>
Codeception Builds
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<!-- CSS -->
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/codeception.css">
<link rel="stylesheet" href="/css/contributors.css">
<link rel="stylesheet" href="/css/algolia.css">
<link rel="stylesheet" type="text/css" media="screen" href="/css/syntax.css">
<!-- SCRIPTS -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="/js/jquery.toc.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/contributors.js" type="text/javascript" charset="utf-8"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script>
<!-- Other -->
<link title="Codeception Blog" type="application/rss+xml" rel="alternate" href="/rss.xml">
<link rel="shortcut icon" href="/images/favicon.png">
<link rel="author" href="https://plus.google.com/+Codeception">
</head>
<body>
<div class="banner hide-small hide-xs">
<a href="https://codeception.com/12-18-2019/codeception-4.html">Codeception 4 is here! Time to upgrade</a>
</div>
<nav class="navbar nav-custom navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/" class="navbar-brand main-logo">
<svg width="81" height="60" style="vertical-align: middle" viewBox="0 0 81 60" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M35.6058 29.2295L22.5186 19.676L34.8582 40.2759L80.9997 2.21027L35.6058 29.2295ZM29.9915 54.4923C16.4012 54.4923 5.38429 43.4968 5.38429 29.9331C5.38429 16.3696 16.4012 5.37379 29.9915 5.37379C36.0092 5.37379 41.5198 7.53284 45.7954 11.1129L49.2448 7.00516C44.0311 2.63716 37.3154 0 29.9915 0C13.4539 0 0 13.428 0 29.9331C0 46.4384 13.4539 59.8664 29.9915 59.8664C38.5677 59.8664 46.3089 56.2494 51.7802 50.4701L47.8767 46.7908C43.3907 51.5302 37.0395 54.4923 29.9915 54.4923ZM29.9915 47.3736C20.3405 47.3736 12.517 39.5654 12.517 29.9332C12.517 20.301 20.3405 12.4925 29.9915 12.4925C34.2649 12.4925 38.176 14.0285 41.2122 16.5709L43.8017 13.4869C40.0621 10.3536 35.2448 8.46205 29.9915 8.46205C18.1291 8.46205 8.47842 18.0939 8.47842 29.9332C8.47842 41.7722 18.1291 51.404 29.9915 51.404C36.1431 51.404 41.696 48.8095 45.6204 44.6642L42.6838 41.8966C39.4983 45.2619 34.9967 47.3736 29.9915 47.3736Z" fill="#236BFD"/>
</svg>CODECEPTION_</a>
</div>
<div class="collapse navbar-collapse menu ">
<ul class="nav navbar-nav navbar-right">
<li><a href="/quickstart">QuickStart</a></li>
<li class="dropdown docs-dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> Docs
<b class="caret"></b>
</a>
<ul class="dropdown-menu multi-column columns-3">
<div class="container">
<div class="row">
<div class="col-sm-4 col-md-4 guides-wrapper">
<ul class="multi-column-dropdown">
<li><h4>Guides</h4></li>
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/04-FunctionalTests">Functional Tests</a></li><li><a href="/docs/05-UnitTests">Unit Tests</a></li><li><a href="/docs/06-ModulesAndHelpers">Modules And Helpers</a></li><li><a href="/docs/06-ReusingTestCode">Reusing Test Code</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/07-BDD">BDD</a></li><li><a href="/docs/08-Customization">Customization</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-APITesting">API Testing</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li><li><a href="/docs/12-ContinuousIntegration">Continuous Integration</a></li><li><a href="/docs/12-ParallelExecution">Parallel Execution</a></li>
<li role="separator" class="divider"></li>
<li><a href="/video">Video</a></li>
</ul>
</div>
<div class="col-sm-5 col-md-6">
<ul class="dropdown-modules multi-column-dropdown clearfix">
<h4>Modules</h4>
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Phalcon">Phalcon</a></li><li><a href="/docs/modules/Phalcon4">Phalcon 4</a></li><li><a href="/docs/modules/Apc">Apc</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/Asserts">Asserts</a></li><li><a href="/docs/modules/Queue">Queue</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/DataFactory">DataFactory</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Sequence">Sequence</a></li><li><a href="/docs/modules/FTP">FTP</a></li><li><a href="/docs/modules/Symfony">Symfony</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/WebDriver">WebDriver</a></li><li><a href="/docs/modules/Laravel5">Laravel5</a></li><li><a href="/docs/modules/Yii2">Yii2</a></li><li><a href="/docs/modules/Lumen">Lumen</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/ZendExpressive">ZendExpressive</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li>
</ul>
</div>
<div class="col-sm-3 col-md-2">
<ul class="multi-column-dropdown"
<li><h4>Reference</h4></li>
<li><a href="/install">Install</a></li>
<li><a href="/docs/reference/Configuration">Configuration</a></li>
<li><a href="/extensions">Extensions</a></li>
<li><a href="/docs/reference/Commands">Commands</a></li></a></li>
<li role="separator" class="divider"></li>
<li><h4>Util Classes</h4></li>
<li><a href="/docs/reference/Autoload">Autoload</a></li><li><a href="/docs/reference/Fixtures">Fixtures</a></li><li><a href="/docs/reference/Functions">Functions</a></li><li><a href="/docs/reference/HttpCode">HttpCode</a></li><li><a href="/docs/reference/InitTemplate">InitTemplate</a></li><li><a href="/docs/reference/JsonType">JsonType</a></li><li><a href="/docs/reference/Locator">Locator</a></li><li><a href="/docs/reference/Mock">Mock</a></li><li><a href="/docs/reference/Module">Module</a></li><li><a href="/docs/reference/Stub">Stub</a></li><li><a href="/docs/reference/XmlBuilder">XmlBuilder</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li>
<a href="/changelog">Releases</a>
</li>
<li>
<a href="/blog">Blog</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="http://phptest.club/category/codeception">
Use Cases
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/for/symfony">Symfony</a></li>
<li><a href="/for/laravel">Laravel</a></li>
<li><a href="/for/yii">Yii Framework</a></li>
<li><a href="/for/phalcon">Phalcon</a></li>
<li><a href="/for/wordpress">WordPress</a></li>
<li><a href="/for/joomla">Joomla</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="http://phptest.club">
Community
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/credits"><strong>Credits</strong></a></li>
<li><a href="/addons">Addons</a></li>
<li><a href="http://phptest.club/c/codeception/cookbook">Cookbook</a></li>
<li role="separator" class="divider"></li>
<li><a href="https://bit.ly/chat-codeception">Join our Slack</a></
<li><a href="https://twitter.com/codeception">Follow us in Twitter</a></li>
<li><a href="https://www.facebook.com/pages/Codeception/288959711204412">Page in Facebook</a></li>
<li role="separator" class="divider"></li>
<li><a href="http://phptest.club/category/codeception">Forum @ PHPTestClub</a></li>
<li><a href="http://automated-testing.info/category/codeception">Russian Forum @ AT.info</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/codeception">StackOverflow</a></li>
<li><a href="https://github.com/codeception/codeception/issues">GitHub Issues</a></li>
<li role="separator" class="divider"></li>
<li><a href="https://opencollective.com/codeception"><strong>Support us via OpenCollective!</strong></a></li>
</ul>
</li>
<li class="hidden-xs">
<a href="https://twitter.com/codeception" class="social-link">
<img src="/images/social/twitter.png" alt="Twitter" title="Follow us in Twitter to recieve updates!">
</a>
</li>
<li class="hidden-xs">
<a href="https://github.com/codeception/codeception" class="social-link">
<img src="/images/social/github.png" alt="GitHub">
</a>
</li>
<li class="hidden-xs">
<a href="https://opencollective.com/codeception/" class="social-link">
<img src="/images/social/opencollective.png" alt="❤ Support us on OpenCollective!">
</a>
</li>
</ul>
</div>
</div> <!-- /.container -->
</nav>
<!-- CONTENT -->
<div class="container-fluid">
<div class="row pt">
<div class="col-sm-12 col-lg-8">
<div class="content page" id="page">
<h2 id="40">4.0</h2>
<p><em>Requires: PHP 5.6 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/4.0.20200124/codecept.phar">Download Latest 4.0 Release</a></strong></li>
<li><a href="https://codeception.com/releases/4.0.20200124/codecept.phar">4.0.20200124 for PHP 7.2+</a>, <a href="https://codeception.com/releases/4.0.20200124/php56/codecept.phar">for PHP 5.6 - 7.1</a></li>
<li><a href="https://codeception.com/releases/4.0.20191223/codecept.phar">4.0.20191223 for PHP 7.2+</a>, <a href="https://codeception.com/releases/4.0.20191223/php56/codecept.phar">for PHP 5.6 - 7.1</a></li>
<li><a href="https://codeception.com/releases/4.0.20191220/codecept.phar">4.0.20191220 for PHP 7.2+</a>, <a href="https://codeception.com/releases/4.0.20191220/php56/codecept.phar">for PHP 5.6 - 7.1</a></li>
<li><a href="https://codeception.com/releases/4.0.20191219/codecept.phar">4.0.20191219 for PHP 7.2+</a>, <a href="https://codeception.com/releases/4.0.20191219/php56/codecept.phar">for PHP 5.6 - 7.1</a></li>
</ul>
<h2 id="31">3.1</h2>
<p><em>Requires: PHP 5.6 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/3.1.2/codecept.phar">Download Latest 3.1 Release</a></strong></li>
<li><a href="https://codeception.com/releases/3.1.2/codecept.phar">3.1.2 for PHP 7</a>, <a href="https://codeception.com/releases/3.1.2/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/3.1.1/codecept.phar">3.1.1 for PHP 7</a>, <a href="https://codeception.com/releases/3.1.1/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/3.1.0/codecept.phar">3.1.0 for PHP 7</a>, <a href="https://codeception.com/releases/3.1.0/php54/codecept.phar">for PHP 5.6</a></li>
</ul>
<h2 id="30">3.0</h2>
<p><em>Requires: PHP 5.6 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/3.0.3/codecept.phar">Download Latest 3.0 Release</a></strong></li>
<li><a href="https://codeception.com/releases/3.0.3/codecept.phar">3.0.3 for PHP 7</a>, <a href="https://codeception.com/releases/3.0.3/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/3.0.2/codecept.phar">3.0.2 for PHP 7</a>, <a href="https://codeception.com/releases/3.0.2/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/3.0.1/codecept.phar">3.0.1 for PHP 7</a>, <a href="https://codeception.com/releases/3.0.1/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/3.0.0/codecept.phar">3.0.0 for PHP 7</a>, <a href="https://codeception.com/releases/3.0.0/php54/codecept.phar">for PHP 5.6</a></li>
</ul>
<h2 id="25">2.5</h2>
<p><em>Requires: PHP 5.6 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.5.6/codecept.phar">Download Latest 2.5 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.5.6/codecept.phar">2.5.6 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.6/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.5/codecept.phar">2.5.5 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.5/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.4/codecept.phar">2.5.4 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.4/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.3/codecept.phar">2.5.3 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.3/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.2/codecept.phar">2.5.2 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.2/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.1/codecept.phar">2.5.1 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.1/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.5.0/codecept.phar">2.5.0 for PHP 7</a>, <a href="https://codeception.com/releases/2.5.0/php54/codecept.phar">for PHP 5.6</a></li>
</ul>
<h2 id="24">2.4</h2>
<p><em>Requires: PHP 5.6 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.4.5/codecept.phar">Download Latest 2.4 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.4.5/codecept.phar">2.4.5 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.5/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.4.4/codecept.phar">2.4.4 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.4/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.4.3/codecept.phar">2.4.3 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.3/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.4.2/codecept.phar">2.4.2 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.2/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.4.1/codecept.phar">2.4.1 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.1/php54/codecept.phar">for PHP 5.6</a></li>
<li><a href="https://codeception.com/releases/2.4.0/codecept.phar">2.4.0 for PHP 7</a>, <a href="https://codeception.com/releases/2.4.0/php54/codecept.phar">for PHP 5.6</a></li>
</ul>
<h2 id="23">2.3</h2>
<p><em>Requires: PHP 5.4 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.3.9/codecept.phar">Download Latest 2.3 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.3.9/codecept.phar">2.3.9 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.9/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.8/codecept.phar">2.3.8 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.8/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.7/codecept.phar">2.3.7 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.7/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.6/codecept.phar">2.3.6 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.6/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.5/codecept.phar">2.3.5 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.5/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.4/codecept.phar">2.3.4 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.4/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.3/codecept.phar">2.3.3 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.3/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.2/codecept.phar">2.3.2 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.2/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.1/codecept.phar">2.3.1 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.1/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
<li><a href="https://codeception.com/releases/2.3.0/codecept.phar">2.3.0 for PHP 7</a>, <a href="https://codeception.com/releases/2.3.0/php54/codecept.phar">for PHP 5.4 - 5.6</a></li>
</ul>
<h2 id="22">2.2</h2>
<p><em>Requires: PHP 5.4 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.2.12/codecept.phar">Download Latest 2.2 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.2.12/codecept.phar">2.2.12 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.12/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.11/codecept.phar">2.2.11 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.11/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.10/codecept.phar">2.2.10 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.10/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.9/codecept.phar">2.2.9 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.9/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.8/codecept.phar">2.2.8 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.8/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.7/codecept.phar">2.2.7 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.7/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.6/codecept.phar">2.2.6 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.6/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.5/codecept.phar">2.2.5 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.5/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.4/codecept.phar">2.2.4 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.4/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.3/codecept.phar">2.2.3 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.3/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.2/codecept.phar">2.2.2 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.2/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.2.1/codecept.phar">2.2.1 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.2.1/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
</ul>
<h2 id="21">2.1</h2>
<p><em>Requires: PHP 5.4 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.1.11/codecept.phar">Download Latest 2.1 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.1.11/codecept.phar">2.1.11 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.11/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.10/codecept.phar">2.1.10 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.10/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.9/codecept.phar">2.1.9 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.9/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.8/codecept.phar">2.1.8 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.8/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.7/codecept.phar">2.1.7 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.7/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.6/codecept.phar">2.1.6 for PHP 5.6+</a>, <a href="https://codeception.com/releases/2.1.6/php54/codecept.phar">for PHP 5.4 or 5.5</a></li>
<li><a href="https://codeception.com/releases/2.1.5/codecept.phar">2.1.5</a></li>
<li><a href="https://codeception.com/releases/2.1.4/codecept.phar">2.1.4</a></li>
<li><a href="https://codeception.com/releases/2.1.3/codecept.phar">2.1.3</a></li>
<li><a href="https://codeception.com/releases/2.1.2/codecept.phar">2.1.2</a></li>
<li><a href="https://codeception.com/releases/2.1.1/codecept.phar">2.1.1</a></li>
<li><a href="https://codeception.com/releases/2.1.0/codecept.phar">2.1.0</a></li>
<li><a href="https://codeception.com/releases/2.1.0-rc1/codecept.phar">2.1.0-rc1</a></li>
<li><a href="https://codeception.com/releases/2.1.0-beta/codecept.phar">2.1.0-beta</a></li>
</ul>
<h2 id="20">2.0</h2>
<p><em>Requires: PHP 5.4 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/2.0.16/codecept.phar">Download Latest 2.0 Release</a></strong></li>
<li><a href="https://codeception.com/releases/2.0.16/codecept.phar">2.0.16</a></li>
<li><a href="https://codeception.com/releases/2.0.15/codecept.phar">2.0.15</a></li>
<li><a href="https://codeception.com/releases/2.0.14/codecept.phar">2.0.14</a></li>
<li><a href="https://codeception.com/releases/2.0.13/codecept.phar">2.0.13</a></li>
<li><a href="https://codeception.com/releases/2.0.12/codecept.phar">2.0.12</a></li>
<li><a href="https://codeception.com/releases/2.0.11/codecept.phar">2.0.11</a></li>
<li><a href="https://codeception.com/releases/2.0.10/codecept.phar">2.0.10</a></li>
<li><a href="https://codeception.com/releases/2.0.9/codecept.phar">2.0.9</a></li>
<li><a href="https://codeception.com/releases/2.0.8/codecept.phar">2.0.8</a></li>
<li><a href="https://codeception.com/releases/2.0.7/codecept.phar">2.0.7</a></li>
<li><a href="https://codeception.com/releases/2.0.6/codecept.phar">2.0.6</a></li>
<li><a href="https://codeception.com/releases/2.0.5/codecept.phar">2.0.5</a></li>
<li><a href="https://codeception.com/releases/2.0.4/codecept.phar">2.0.4</a></li>
<li><a href="https://codeception.com/releases/2.0.3/codecept.phar">2.0.3</a></li>
<li><a href="https://codeception.com/releases/2.0.2/codecept.phar">2.0.2</a></li>
<li><a href="https://codeception.com/releases/2.0.1/codecept.phar">2.0.1</a></li>
<li><a href="https://codeception.com/releases/2.0.0/codecept.phar">2.0.0</a></li>
<li><a href="https://codeception.com/releases/2.0.0-RC2/codecept.phar">2.0.0-RC2</a></li>
<li><a href="https://codeception.com/releases/2.0.0-RC/codecept.phar">2.0.0-RC</a></li>
<li><a href="https://codeception.com/releases/2.0.0-beta/codecept.phar">2.0.0-beta</a></li>
<li><a href="https://codeception.com/releases/2.0.0-alpha/codecept.phar">2.0.0-alpha</a></li>
</ul>
<h2 id="18">1.8</h2>
<p><em>Requires: PHP 5.3 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/1.8.7/codecept.phar">Download Latest 1.8 Release</a></strong></li>
<li><a href="https://codeception.com/releases/1.8.7/codecept.phar">1.8.7</a></li>
<li><a href="https://codeception.com/releases/1.8.6/codecept.phar">1.8.6</a></li>
<li><a href="https://codeception.com/releases/1.8.5/codecept.phar">1.8.5</a></li>
<li><a href="https://codeception.com/releases/1.8.4/codecept.phar">1.8.4</a></li>
<li><a href="https://codeception.com/releases/1.8.3/codecept.phar">1.8.3</a></li>
<li><a href="https://codeception.com/releases/1.8.2/codecept.phar">1.8.2</a></li>
<li><a href="https://codeception.com/releases/1.8.1/codecept.phar">1.8.1</a></li>
<li><a href="https://codeception.com/releases/1.8.0.1/codecept.phar">1.8.0.1</a></li>
<li><a href="https://codeception.com/releases/1.8.0/codecept.phar">1.8.0</a></li>
</ul>
<h2 id="17">1.7</h2>
<p><em>Requires: PHP 5.3 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/1.7.4/codecept.phar">Download Latest 1.7 Release</a></strong></li>
<li><a href="https://codeception.com/releases/1.7.4/codecept.phar">1.7.4</a></li>
<li><a href="https://codeception.com/releases/1.7.3/codecept.phar">1.7.3</a></li>
<li><a href="https://codeception.com/releases/1.7.2/codecept.phar">1.7.2</a></li>
<li><a href="https://codeception.com/releases/1.7.1/codecept.phar">1.7.1</a></li>
<li><a href="https://codeception.com/releases/1.7.0.2/codecept.phar">1.7.0.2</a></li>
<li><a href="https://codeception.com/releases/1.7.0.1/codecept.phar">1.7.0.1</a></li>
<li><a href="https://codeception.com/releases/1.7.0/codecept.phar">1.7.0</a></li>
</ul>
<h2 id="16">1.6</h2>
<p><em>Requires: PHP 5.3 and higher + CURL</em></p>
<ul>
<li><strong><a href="https://codeception.com/releases/1.6.12/codecept.phar">Download Latest 1.6 Release</a></strong></li>
<li><a href="https://codeception.com/releases/1.6.12/codecept.phar">1.6.12</a></li>
<li><a href="https://codeception.com/releases/1.6.11/codecept.phar">1.6.11</a></li>
<li><a href="https://codeception.com/releases/1.6.10/codecept.phar">1.6.10</a></li>
<li><a href="https://codeception.com/releases/1.6.9/codecept.phar">1.6.9</a></li>
<li><a href="https://codeception.com/releases/1.6.8.1/codecept.phar">1.6.8.1</a></li>
</ul>
</div>
</div>
<div class="col-sm-12 col-lg-4">
<div class="well">
<a class="btn btn-lg btn-warning btn-block" href="/quickstart">Quick Start →</a>
<p><br/>Write and execute a test for an existing app
<b>in less than a 5 mins!</b>
</p>
</div>
<div class="links">
<p>
<a href="https://codeception.com/thanks.html">
<img src="https://poser.pugx.org/Codeception/Codeception/version.png" alt="Latest stable version">
</a>
<img
src="https://camo.githubusercontent.com/ba3ef343659e0ec242700c28c571dd89c6fd54d8/68747470733a2f2f706f7365722e707567782e6f72672f636f646563657074696f6e2f636f646563657074696f6e2f646f776e6c6f6164732e706e67"
alt="Total Downloads" data-canonical-src="https://poser.pugx.org/codeception/codeception/downloads.png">
</p>
<p>
<a href="http://phptest.club/c/codeception" class="test-forum">
<img src="/images/phptestclub.png"><br> Community Forum
</a>
</p>
<p>
<a href="https://github.com/codeception/codeception">
<img src="/images/social/github.png">GitHub Repository
</a>
</p>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#toc').toc({
'selectors': 'h2',
'prefix': 'toc',
'container': '#page',
'anchorName': function (i, heading, prefix) { //custom function for anchor name
return $(heading).text().replace(/\s/g, '-').replace(/[^\w-]/g, '');
},
});
});
</script>
</div>
<div class="d-none d-lg-block support-wrapper">
<div class="container w-50">
<div class="text-center">
<a href="https://opencollective.com/codeception/" class="btn btn-success" role="button">❤️ Support us on OpenCollective!</a>
</div>
</div>
</div>
<div id="footer">
<div class="container-fluid">
<ul class="links">
<li class="footer-logo">
<a href="/">
<h4>
<img src="/images/logo_footer.svg" alt="logo">Codeception_
</h4>
</a>
</li>
<li><a href="/install">Installation</a></li>
<li><a href="/credits">Credits</a></li>
<li><a href="/changelog">Releases</a></li>
<li><a href="http://sdclabs.com/codeception?utm_source=codeception.com&utm_medium=bottom_menu&utm_term=link&utm_campaign=reference" >Enterprise Support</a></li>
<li><a href="http://sdclabs.com/trainings?utm_source=codeception.com&utm_medium=bottom_menu&utm_term=link&utm_campaign=reference" >Trainings</a></li>
</ul>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 col-md-4 col-lg-3 col-lg-offset-1">
<p>
Codeception is a BDD-styled PHP testing framework, brought to you by <a href="https://codeception.com/credits">Codeception Team</a>.
OpenSource <strong>MIT Licensed</strong>.
</p>
</div>
<div class="col-sm-6 col-md-4 col-lg-3 col-lg-offset-1 text-center footer-social">
<a href="https://github.com/codeception/codeception" class="social">
<img src="/images/social/github-white.png" alt="GitHub">
</a>
<a href="https://twitter.com/codeception" class="social">
<img src="/images/social/twitter-white.png" alt="Twitter">
</a>
<a href="https://www.facebook.com/pages/Codeception/288959711204412" class="social">
<img src="/images/social/facebook-white.png" alt="Facebook">
<a href="https://bit.ly/chat-codeception" class="social">
<img src="/images/slack.png" alt="Slack" title="Slack Chat">
</a>
</a>
</div>
<div class="col-sm-6 col-md-4 col-lg-4 text-center">
<h4>they support us_</h4>
<a href="https://www.jetbrains.com/phpstorm/" rel=nofollow><img src="/images/support/phpstorm.png" alt="PhpStorm" class="sponsors sponsors--phpstorm"></a>
<a href="https://www.rebilly.com/" rel=nofollow><img src="/images/support/rebilly.png" class="sponsors sponsors--rebilly" alt="Your Partner
In Subscription Billing
Uncover your revenue potential with
our recurring billing software." title="Your Partner
In Subscription Billing"></a>
<a href="https://themeisle.com/" rel=nofollow><img src="/images/support/themeisle.png" class="sponsors sponsors--themeisle" alt="Premium WordPress themes, Templates & Plugins"></a>
</div>
</div>
</div>
<div id="copyright">
<div class="design">
Design made by
<a href="https://pizdata.is/">
<svg width="17" height="22" viewBox="0 0 17 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.1521 4.64018L13.5305 3.83959L12.2672 5.6787C11.3601 4.22562 9.35785 1.74674 5.75912 0.57675L3.98126 0L4.88607 1.58776C4.89702 1.60708 5.83747 3.28537 5.66941 5.11943L2.80415 3.48567L3.14267 5.05097C3.14982 5.08409 3.83233 8.3093 3.20491 11.3562C3.12457 11.421 3.01509 11.4774 2.86608 11.4774C2.63863 11.4774 2.13696 11.3484 1.33672 10.4825L0.283136 9.3428L0.0669574 10.8565C0.056478 10.9316 -0.934383 18.4053 5.07684 21.1622C6.18671 21.71 7.48187 22 8.8226 22H8.82308C11.2433 22 13.4927 21.0735 14.9939 19.4586C16.5583 17.7762 17.2281 15.4572 16.9315 12.7513C16.9202 12.2855 16.744 7.9779 14.1521 4.64018Z" fill="white"/>
</svg><strong>Pizdata</strong>
</a>
</div>
<div>
© Codeception 2011&ndash;2020
</div>
</div>
</div>
</div>
<!-- SCRIPTS -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1899308-9']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
// Adding this layout functionality for mobile views with the homepage hero
$(document).ready(function(){
$('.navbar-toggle').click(function(){
$('.row.home').toggleClass('no-padding-top');
});
});
</script>
<div class="visible-lg-block twitter-btn">
<aside>
<a href="https://twitter.com/codeception" class="twitter-follow-button" data-show-count="false"
data-lang="en" data-size="large">Follow @Codeception</a>
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "twitter-wjs");</script>
</aside>
</div>
<script>
window.ALGOLIA_CONFIG = {
'applicationId': 'G160Y1N5OT',
'indexName': 'codeception',
'apiKey': 'c264188100c4fb7017c4f5702a7d4b8d',
'baseurl': ''
}
</script>
<script id="algolia__template" type="text/template">
<div class="algolia__result">
<a class="algolia__result-link" href="{{ full_url }}#algolia:{{ css_selector }}">{{{ _highlightResult.title.value }}}</a>
{{#posted_at}}
<div class="algolia__result-date">{{ posted_at_readable }}</div>
{{/posted_at}}
<div class="algolia__result-text">{{{ _highlightResult.text.value }}}</div>
</div>
</script>
<script id="algolia__template--no-results" type="text/template">
No results found.
</script>
<script src="//cdn.jsdelivr.net/algoliasearch/3.6.0/algoliasearch.min.js"></script>
<script src="//cdn.jsdelivr.net/algoliasearch.helper/2.1.0/algoliasearch.helper.min.js"></script>
<script src="//cdn.jsdelivr.net/hogan.js/3.0.2/hogan.min.js"></script>
<script src="//cdn.jsdelivr.net/momentjs/2.10.3/moment.min.js"></script>
<script src="/js/algolia.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

70
dist/index.js vendored
View File

@ -1703,20 +1703,13 @@ exports.getUri = getUri;
* Helper function to get the codeception url
*
* @param version
* @param php_version
* @param suffix
*/
function getCodeceptionUriBuilder(version, php_version, suffix) {
function getCodeceptionUriBuilder(version, suffix) {
return __awaiter(this, void 0, void 0, function* () {
switch (true) {
case /^5\.6$|^7\.[0|1]$/.test(php_version):
return ['releases', version, suffix, 'codecept.phar']
.filter(Boolean)
.join('/');
case /^7\.[2-4]$/.test(php_version):
default:
return ['releases', version, 'codecept.phar'].filter(Boolean).join('/');
}
return ['releases', version, suffix, 'codecept.phar']
.filter(Boolean)
.join('/');
});
}
exports.getCodeceptionUriBuilder = getCodeceptionUriBuilder;
@ -1728,19 +1721,55 @@ exports.getCodeceptionUriBuilder = getCodeceptionUriBuilder;
*/
function getCodeceptionUri(version, php_version) {
return __awaiter(this, void 0, void 0, function* () {
const codecept = yield getCodeceptionUriBuilder(version, '');
const codecept54 = yield getCodeceptionUriBuilder(version, 'php54');
const codecept56 = yield getCodeceptionUriBuilder(version, 'php56');
// Refer to https://codeception.com/builds
switch (true) {
case /latest/.test(version):
switch (true) {
case /^5\.6$|^7\.[0|1]$/.test(php_version):
case /5\.6|7\.[0|1]/.test(php_version):
return 'php56/codecept.phar';
case /^7\.[2-4]$/.test(php_version):
case /7\.[2-4]/.test(php_version):
default:
return 'codecept.phar';
}
case /([4-9]|\d{2,})\..*/.test(version):
return yield getCodeceptionUriBuilder(version, php_version, 'php56');
case /(^[4-9]|\d{2,})\..*/.test(version):
switch (true) {
case /5\.6|7\.[0|1]/.test(php_version):
return codecept56;
case /7\.[2-4]/.test(php_version):
default:
return codecept;
}
case /(^2\.[4-5]\.\d+|^3\.[0-1]\.\d+).*/.test(version):
switch (true) {
case /5\.6/.test(php_version):
return codecept54;
case /7\.[0-4]/.test(php_version):
default:
return codecept;
}
case /^2\.3\.\d+.*/.test(version):
switch (true) {
case /5\.[4-6]/.test(php_version):
return codecept54;
case /^7\.[0-4]$/.test(php_version):
default:
return codecept;
}
case /(^2\.(1\.([6-9]|\d{2,}))|^2\.2\.\d+).*/.test(version):
switch (true) {
case /5\.[4-5]/.test(php_version):
return codecept54;
case /5.6|7\.[0-4]/.test(php_version):
default:
return codecept;
}
case /(^2\.(1\.[0-5]|0\.\d+)|^1\.[6-8]\.\d+).*/.test(version):
return codecept;
default:
return yield getCodeceptionUriBuilder(version, php_version, 'php54');
return yield codecept;
}
});
}
@ -2104,7 +2133,7 @@ exports.addCoverageXdebug = addCoverageXdebug;
function addCoveragePCOV(version, os_version, pipe) {
return __awaiter(this, void 0, void 0, function* () {
let script = '\n';
switch (version) {
switch (true) {
default:
script +=
(yield extensions.addExtension('pcov', version, os_version, true)) +
@ -2126,8 +2155,7 @@ function addCoveragePCOV(version, os_version, pipe) {
script += yield utils.addLog('$tick', 'coverage: pcov', 'PCOV enabled as coverage driver', os_version);
// version is not supported
break;
case '5.6':
case '7.0':
case /5\.[3-6]|7\.0/.test(version):
script += yield utils.addLog('$cross', 'pcov', 'PHP 7.1 or newer is required', os_version);
break;
}
@ -2373,7 +2401,7 @@ function run() {
case 'darwin':
case 'linux':
script_path = yield build(os_version + '.sh', version, os_version);
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
yield exec_1.exec('bash ' + script_path + ' ' + version + ' ' + __dirname);
break;
case 'win32':
script_path = yield build('win32.ps1', version, os_version);
@ -2805,7 +2833,7 @@ function addExtensionLinux(extension_csv, version, pipe) {
// match 7.0xdebug..7.4xdebug
case /^7\.[0-4]xdebug$/.test(version_extension):
script +=
'\nupdate_extension xdebug 2.9.0' +
'\nupdate_extension xdebug 2.9.1' +
pipe +
'\n' +
(yield utils.addLog('$tick', 'xdebug', 'Enabled', 'linux'));

View File

@ -54,7 +54,7 @@ export async function addCoveragePCOV(
pipe: string
): Promise<string> {
let script = '\n';
switch (version) {
switch (true) {
default:
script +=
(await extensions.addExtension('pcov', version, os_version, true)) +
@ -83,8 +83,8 @@ export async function addCoveragePCOV(
);
// version is not supported
break;
case '5.6':
case '7.0':
case /5\.[3-6]|7\.0/.test(version):
script += await utils.addLog(
'$cross',
'pcov',

View File

@ -174,7 +174,7 @@ export async function addExtensionLinux(
// match 7.0xdebug..7.4xdebug
case /^7\.[0-4]xdebug$/.test(version_extension):
script +=
'\nupdate_extension xdebug 2.9.0' +
'\nupdate_extension xdebug 2.9.1' +
pipe +
'\n' +
(await utils.addLog('$tick', 'xdebug', 'Enabled', 'linux'));

View File

@ -67,7 +67,7 @@ export async function run(): Promise<void> {
case 'darwin':
case 'linux':
script_path = await build(os_version + '.sh', version, os_version);
await exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
await exec('bash ' + script_path + ' ' + version + ' ' + __dirname);
break;
case 'win32':
script_path = await build('win32.ps1', version, os_version);

View File

@ -34,8 +34,8 @@ add_extension() {
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q -w "$extension"; then
if [[ "$version" =~ $old_versions ]]; then
(eval "$install_command" >/dev/null 2>&1 && echo "$prefix=$ext_dir/$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Installed and enabled") ||
(sudo port install php"$nodot_version"-"$extension" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
(eval "$install_command" >/dev/null 2>&1 && echo "$prefix=$ext_dir/$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Installed and enabled") ||
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
else
(eval "$install_command" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
@ -102,12 +102,13 @@ add_tool() {
if [ "$status_code" = "200" ]; then
sudo chmod a+x "$tool_path"
if [ "$tool" = "phive" ]; then
add_extension curl >/dev/null 2>&1
add_extension mbstring >/dev/null 2>&1
add_extension xml >/dev/null 2>&1
add_extension curl "sudo pecl install -f curl" extension >/dev/null 2>&1
add_extension mbstring "sudo pecl install -f mbstring" extension >/dev/null 2>&1
add_extension xml "sudo pecl install -f xml" extension >/dev/null 2>&1
elif [ "$tool" = "cs2pr" ]; then
sudo sed -i '' 's/exit(9)/exit(0)/' "$tool_path"
tr -d '\r' < "$tool_path" | sudo tee "$tool_path.tmp" >/dev/null 2>&1 && sudo mv "$tool_path.tmp" "$tool_path"
sudo chmod a+x "$tool_path"
fi
add_log "$tick" "$tool" "Added"
else

View File

@ -1,12 +1,76 @@
php_h="https://raw.githubusercontent.com/php/php-src/PHP-$2/main/php.h"
linux_extension_dir() {
apiv=$1
if [ "$version" = "5.3" ]; then
echo "/home/runner/php/5.3.29/lib/php/extensions/no-debug-non-zts-$apiv"
elif [[ "$version" =~ $old_versions_linux ]]; then
echo "/usr/lib/php5/$apiv"
elif [ "$version" = "8.0" ]; then
echo "/home/runner/php/8.0/lib/php/extensions/no-debug-non-zts-$apiv"
else
echo "/usr/lib/php/$apiv"
fi
}
darwin_extension_dir() {
apiv=$1
if [[ "$version" =~ $old_versions_darwin ]]; then
echo "/opt/local/lib/php${version/./}/extensions/no-debug-non-zts-$apiv"
else
echo "/usr/local/lib/php/pecl/$apiv"
fi
}
get_apiv() {
case $version in
5.3)
echo "20090626"
;;
5.4)
echo "20100525"
;;
5.5)
echo "20121212"
;;
5.6)
echo "20131226"
;;
7.0)
echo "20151012"
;;
7.1)
echo "20160303"
;;
7.2)
echo "20170718"
;;
7.3)
echo "20180731"
;;
*)
if [ "$version" = "8.0" ]; then
php_h="https://raw.githubusercontent.com/php/php-src/master/main/php.h"
else
semver=$(curl -sSL --retry 5 https://github.com/php/php-src/releases | grep "$flags" "(php-$version.[0-9]+)".zip | head -n 1 | grep "$flags" '[0-9]+\.[0-9]+\.[0-9]+')
php_h="https://raw.githubusercontent.com/php/php-src/PHP-$semver/main/php.h"
fi
curl -sSL --retry 5 "$php_h" | grep "PHP_API_VERSION" | cut -d' ' -f 3
;;
esac
}
version=$2
old_versions_linux="5.[4-5]"
old_versions_darwin="5.[3-5]"
os=$(uname -s)
if [ "$os" = "Linux" ]; then
apiv=$(curl -sSL --retry 5 "$php_h" | grep "PHP_API_VERSION" | cut -d' ' -f 3)
dir="/usr/lib/php/$apiv"
sudo mkdir -p "$dir" && sudo chown -R "$USER":"$(id -g -n)" /usr/lib/php
flags='-Po'
apiv=$(get_apiv)
dir=$(linux_extension_dir "$apiv")
sudo mkdir -p "$dir" && sudo chown -R "$USER":"$(id -g -n)" $(dirname "$dir")
elif [ "$os" = "Darwin" ]; then
apiv=$(curl -sSL --retry 5 "$php_h" | grep "PHP_API_VERSION" | cut -d' ' -f 3)
dir="/usr/local/lib/php/pecl/$apiv"
flags='-Eo'
apiv=$(get_apiv)
dir=$(darwin_extension_dir "$apiv")
else
dir='C:\\tools\\php\\ext'
fi

View File

@ -19,8 +19,13 @@ add_log() {
# Function to update php ppa
update_ppa() {
if [ "$ppa_updated" = "false" ]; then
find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
ppa_updated="true"
if [[ "$version" =~ $old_versions ]]; then
ppa="dotdeb-ubuntu-php*.list"
else
ppa="ondrej-ubuntu-php*.list"
fi
find /etc/apt/sources.list.d -type f -name "$ppa" -exec sudo DEBIAN_FRONTEND=noninteractive apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
echo "true"
fi
}
@ -53,15 +58,18 @@ add_extension() {
extension=$1
install_command=$2
prefix=$3
if [[ "$version" =~ $old_versions ]]; then
install_command="ppa_updated=$(update_ppa) && ${install_command/5\.[4-5]-$extension/5-$extension=$release_version}"
fi
if ! php -m | grep -i -q -w "$extension" && [ -e "$ext_dir/$extension.so" ]; then
# shellcheck disable=SC2046
$apt_install $(apt-cache depends php"$version"-"$extension" | awk '/Depends:/{print$2}') >/dev/null 2>&1
echo "$prefix=$extension" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
$apt_install $(apt-cache depends php"$version"-"$extension" 2>/dev/null | awk '/Depends:/{print$2}') >/dev/null 2>&1
echo "$prefix=$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
elif php -m | grep -i -q -w "$extension"; then
add_log "$tick" "$extension" "Enabled"
elif ! php -m | grep -i -q -w "$extension"; then
(eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
(update_ppa && eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
(eval "$install_command" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
(ppa_updated=$(update_ppa) && eval "$install_command" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
(sudo pecl install -f "$extension" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
fi
@ -72,7 +80,7 @@ add_extension() {
delete_extension() {
extension=$1
sudo sed -i "/$extension/d" "$ini_file"
sudo rm -rf /etc/php/"$version"/cli/conf.d/*"$extension"* >/dev/null 2>&1
sudo rm -rf "$scan_dir"/*"$extension"* >/dev/null 2>&1
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
}
@ -103,7 +111,7 @@ add_unstable_extension() {
if ! php -m | grep -i -q -w "$extension" && [ -e "$ext_dir/$extension.so" ]; then
extension_version=$(php -d="$prefix=$extension" -r "echo phpversion('$extension');")
if [ "$extension_version" = "$pecl_version" ]; then
echo "$prefix=$extension" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
echo "$prefix=$extension.so" >>"$ini_file" && add_log "$tick" "$extension" "Enabled"
else
delete_extension "$extension"
add_pecl_extension "$extension" "$pecl_version"
@ -130,7 +138,7 @@ update_extension() {
if [ "$final_version" != "$current_version" ]; then
version_exists=$(apt-cache policy -- *"$extension" | grep "$final_version")
if [ -z "$version_exists" ]; then
update_ppa
ppa_updated=$(update_ppa)
fi
$apt_install php"$version"-"$extension"
fi
@ -152,9 +160,9 @@ add_tool() {
elif [ "$tool" = "cs2pr" ]; then
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
elif [ "$tool" = "phive" ]; then
add_extension curl >/dev/null 2>&1
add_extension mbstring >/dev/null 2>&1
add_extension xml >/dev/null 2>&1
add_extension curl "$apt_install php$version-curl" extension >/dev/null 2>&1
add_extension mbstring "$apt_install php$version-mbstring" extension >/dev/null 2>&1
add_extension xml "$apt_install php$version-xml" extension >/dev/null 2>&1
fi
add_log "$tick" "$tool" "Added"
else
@ -190,13 +198,29 @@ setup_master() {
install_dir=~/php/"$version"
sudo mkdir -m 777 -p ~/php
$apt_install libicu-dev >/dev/null 2>&1
curl -o "$tar_file" -L https://bintray.com/shivammathur/php/download_file?file_path="$tar_file" >/dev/null 2>&1
curl -SLO https://dl.bintray.com/shivammathur/php/"$tar_file" >/dev/null 2>&1
sudo tar xf "$tar_file" -C ~/php >/dev/null 2>&1
rm -rf "$tar_file"
sudo ln -sf -S "$version" "$install_dir"/bin/* /usr/bin/
sudo ln -sf "$install_dir"/etc/php.ini /etc/php.ini
}
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5
setup_old_versions() {
(
cd /tmp || exit
curl -SLO https://dl.bintray.com/shivammathur/php/php-"$version".tar.xz >/dev/null 2>&1
sudo tar xf php-"$version".tar.xz >/dev/null 2>&1
cd php-"$version" || exit
sudo chmod a+x ./*.sh
./install.sh >/dev/null 2>&1
./post-install.sh >/dev/null 2>&1
)
sudo rm -rf /tmp/php-"$version"
configure_pecl
release_version=$(php -v | head -n 1 | cut -d' ' -f 2)
}
# Function to setup PECL
add_pecl() {
add_devtools
@ -222,20 +246,25 @@ cross="✗"
ppa_updated="false"
pecl_config="false"
version=$1
old_versions="5.[4-5]"
apt_install="sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y"
existing_version=$(php-config --version | cut -c 1-3)
# Setup PHP
step_log "Setup PHP"
sudo mkdir -p /var/run
sudo mkdir -p /run/php
sudo mkdir -p /var/run /run/php
if [ "$existing_version" != "$version" ]; then
if [ ! -e "/usr/bin/php$version" ]; then
update_ppa
if [ "$version" = "8.0" ]; then
setup_master
elif [[ "$version" =~ $old_versions ]] || [ "$version" = "5.3" ]; then
setup_old_versions
else
version_exists=$(apt-cache policy -- php"$version" | grep "$version")
if [ -z "$version_exists" ]; then
ppa_updated=$(update_ppa)
fi
$apt_install php"$version" php"$version"-curl php"$version"-mbstring php"$version"-xml >/dev/null 2>&1
fi
status="installed"
@ -243,7 +272,9 @@ if [ "$existing_version" != "$version" ]; then
status="switched"
fi
switch_version
if [ "$version" != "5.3" ]; then
switch_version
fi
if [ "$version" = "8.0" ]; then
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
@ -262,6 +293,7 @@ else
fi
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
sudo chmod 777 "$ini_file"
add_log "$tick" "PHP" "$status"

View File

@ -138,23 +138,15 @@ export async function getUri(
* Helper function to get the codeception url
*
* @param version
* @param php_version
* @param suffix
*/
export async function getCodeceptionUriBuilder(
version: string,
php_version: string,
suffix: string
): Promise<string> {
switch (true) {
case /^5\.6$|^7\.[0|1]$/.test(php_version):
return ['releases', version, suffix, 'codecept.phar']
.filter(Boolean)
.join('/');
case /^7\.[2-4]$/.test(php_version):
default:
return ['releases', version, 'codecept.phar'].filter(Boolean).join('/');
}
return ['releases', version, suffix, 'codecept.phar']
.filter(Boolean)
.join('/');
}
/**
@ -167,19 +159,55 @@ export async function getCodeceptionUri(
version: string,
php_version: string
): Promise<string> {
const codecept: string = await getCodeceptionUriBuilder(version, '');
const codecept54: string = await getCodeceptionUriBuilder(version, 'php54');
const codecept56: string = await getCodeceptionUriBuilder(version, 'php56');
// Refer to https://codeception.com/builds
switch (true) {
case /latest/.test(version):
switch (true) {
case /^5\.6$|^7\.[0|1]$/.test(php_version):
case /5\.6|7\.[0|1]/.test(php_version):
return 'php56/codecept.phar';
case /^7\.[2-4]$/.test(php_version):
case /7\.[2-4]/.test(php_version):
default:
return 'codecept.phar';
}
case /([4-9]|\d{2,})\..*/.test(version):
return await getCodeceptionUriBuilder(version, php_version, 'php56');
case /(^[4-9]|\d{2,})\..*/.test(version):
switch (true) {
case /5\.6|7\.[0|1]/.test(php_version):
return codecept56;
case /7\.[2-4]/.test(php_version):
default:
return codecept;
}
case /(^2\.[4-5]\.\d+|^3\.[0-1]\.\d+).*/.test(version):
switch (true) {
case /5\.6/.test(php_version):
return codecept54;
case /7\.[0-4]/.test(php_version):
default:
return codecept;
}
case /^2\.3\.\d+.*/.test(version):
switch (true) {
case /5\.[4-6]/.test(php_version):
return codecept54;
case /^7\.[0-4]$/.test(php_version):
default:
return codecept;
}
case /(^2\.(1\.([6-9]|\d{2,}))|^2\.2\.\d+).*/.test(version):
switch (true) {
case /5\.[4-5]/.test(php_version):
return codecept54;
case /5.6|7\.[0-4]/.test(php_version):
default:
return codecept;
}
case /(^2\.(1\.[0-5]|0\.\d+)|^1\.[6-8]\.\d+).*/.test(version):
return codecept;
default:
return await getCodeceptionUriBuilder(version, php_version, 'php54');
return await codecept;
}
}

Binary file not shown.