From 4034b8b2c0949c304048b8281013f188f3858566 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 5 Dec 2019 15:38:34 -0500 Subject: [PATCH] Update minimum PHP version to 7.2, bump version number --- .travis.yml | 3 +-- Jenkinsfile | 28 ---------------------------- build/header_comment.txt | 6 +++--- composer.json | 1 + tests/ConfigTest.php | 23 +++++++++++++---------- tests/Di/ContainerAwareTest.php | 5 +++-- 6 files changed, 21 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 950a8e5..3411168 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/Jenkinsfile b/Jenkinsfile index debe479..a4bb504 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 { diff --git a/build/header_comment.txt b/build/header_comment.txt index baf0af8..0c0f784 100644 --- a/build/header_comment.txt +++ b/build/header_comment.txt @@ -3,13 +3,13 @@ * * Building blocks for web development * - * PHP version 7.1 + * PHP version 7.2 * * @package Ion * @author Timothy J. Warren * @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 */ diff --git a/composer.json b/composer.json index c9479cf..e2912fb 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index c62c088..f878749 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -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')); } diff --git a/tests/Di/ContainerAwareTest.php b/tests/Di/ContainerAwareTest.php index 8ec3710..ac77b38 100644 --- a/tests/Di/ContainerAwareTest.php +++ b/tests/Di/ContainerAwareTest.php @@ -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