Update minimum PHP version to 7.2, bump version number

This commit is contained in:
Timothy Warren 2019-12-05 15:38:34 -05:00
parent a2cb95aa5b
commit 4034b8b2c0
6 changed files with 21 additions and 45 deletions

View File

@ -4,7 +4,6 @@ install:
- composer install
php:
- 7.1
- 7.2
- 7.3
- 7.4
@ -15,7 +14,7 @@ script:
- vendor/bin/phpunit -c build
services:
- redis
- redis-server
matrix:
allow_failures:

28
Jenkinsfile vendored
View File

@ -1,34 +1,6 @@
pipeline {
agent none
stages {
stage('PHP 7.0') {
agent {
docker {
image 'php:7-alpine'
args '-u root --privileged'
}
}
steps {
sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install --ignore-platform-reqs'
sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
}
}
stage('PHP 7.1') {
agent {
docker {
image 'php:7.1-alpine'
args '-u root --privileged'
}
}
steps {
sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install --ignore-platform-reqs'
sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
}
}
stage('PHP 7.2') {
agent {
docker {

View File

@ -3,13 +3,13 @@
*
* Building blocks for web development
*
* PHP version 7.1
* PHP version 7.2
*
* @package Ion
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2015 - 2019 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version 2.4.1
* @link https://git.timshomepage.net/timw4mail/ion
* @version 3.0.0
* @link https://git.timshomepage.net/aviat/ion
*/

View File

@ -21,6 +21,7 @@
"aura/html": "2.*",
"danielstjules/stringy": "^3.0.0",
"ext-json": "*",
"php": "^7.2",
"psr/http-message": "~1.0",
"psr/log": "~1.0",
"zendframework/zend-diactoros": "^2.0.0",

View File

@ -20,7 +20,10 @@ use Aviat\Ion\Config;
class ConfigTest extends Ion_TestCase {
public function setUp(): void {
protected $config;
public function setUp(): void
{
$this->config = new Config([
'foo' => 'bar',
'asset_path' => '/assets',
@ -33,7 +36,7 @@ class ConfigTest extends Ion_TestCase {
]);
}
public function testConfigHas()
public function testConfigHas(): void
{
$this->assertTrue($this->config->has('foo'));
$this->assertTrue($this->config->has(['a', 'b', 'c']));
@ -42,7 +45,7 @@ class ConfigTest extends Ion_TestCase {
$this->assertFalse($this->config->has(['c', 'b', 'a']));
}
public function testConfigGet()
public function testConfigGet(): void
{
$this->assertEquals('bar', $this->config->get('foo'));
$this->assertEquals('baz', $this->config->get('bar'));
@ -50,26 +53,26 @@ class ConfigTest extends Ion_TestCase {
$this->assertNull($this->config->get(['apple', 'sauce', 'is']));
}
public function testConfigSet()
public function testConfigSet(): void
{
$ret = $this->config->set('foo', 'foobar');
$this->assertInstanceOf('Aviat\Ion\Config', $ret);
$this->assertInstanceOf(Config::class, $ret);
$this->assertEquals('foobar', $this->config->get('foo'));
$this->config->set(['apple', 'sauce', 'is'], 'great');
$apple = $this->config->get('apple');
$this->assertEquals('great', $apple['sauce']['is'], "Config value not set correctly");
$this->assertEquals('great', $apple['sauce']['is'], 'Config value not set correctly');
$this->assertEquals('great', $this->config->get(['apple', 'sauce', 'is']), "Array argument get for config failed.");
}
public function testConfigBadSet()
public function testConfigBadSet(): void
{
$this->expectException('InvalidArgumentException');
$this->config->set(NULL, FALSE);
}
public function dataConfigDelete()
public function dataConfigDelete(): array
{
return [
'top level delete' => [
@ -129,7 +132,7 @@ class ConfigTest extends Ion_TestCase {
/**
* @dataProvider dataConfigDelete
*/
public function testConfigDelete($key, $assertKeys)
public function testConfigDelete($key, array $assertKeys): void
{
$config = new Config([]);
$config->set(['apple', 'sauce', 'is'], 'great');
@ -141,7 +144,7 @@ class ConfigTest extends Ion_TestCase {
}
}
public function testGetNonExistentConfigItem()
public function testGetNonExistentConfigItem(): void
{
$this->assertNull($this->config->get('foobar'));
}

View File

@ -33,12 +33,13 @@ class ContainerAwareTest extends Ion_TestCase {
protected $aware;
public function setUp(): void {
public function setUp(): void
{
$this->container = new Container();
$this->aware = new Aware($this->container);
}
public function testContainerAwareTrait()
public function testContainerAwareTrait(): void
{
// The container was set in setup
// check that the get method returns the same