Skip to content

Commit

Permalink
Upgrade to PHP 8.1 (#9)
Browse files Browse the repository at this point in the history
* Updated PHP requirement to >=8.0

* Updated codeception to ^5

* Removed mindplay/simple-cache dev-dependency

* Replaced Travis with Github Actions
  • Loading branch information
vortrixs authored Aug 24, 2022
1 parent 6288bb5 commit ba75331
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 39 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Codeception tests

on: [push]

jobs:
build:
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: [ ubuntu-latest, ubuntu-20.04 ]
php: [ '8.0', '8.1' ]

steps:
- uses: actions/checkout@master

- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}

- name: Install dependencies
run: composer install

- name: Run tests
run: php vendor/bin/codecept run
5 changes: 0 additions & 5 deletions .scrutinizer.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kodus/file-cache
================

[![PHP Version](https://img.shields.io/badge/php-5.6%2B-blue.svg)](https://packagist.org/packages/kodus/file-cache)
[![PHP Version](https://img.shields.io/badge/php-8.0%2B-blue.svg)](https://packagist.org/packages/kodus/file-cache)
[![Build Status](https://travis-ci.org/kodus/file-cache.svg?branch=master)](https://travis-ci.org/kodus/file-cache)
[![Code Coverage](https://scrutinizer-ci.com/g/kodus/file-cache/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodus/file-cache/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodus/file-cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodus/file-cache/?branch=master)
Expand Down
3 changes: 1 addition & 2 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ coverage:
- src/*
paths:
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
extensions:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"psr/simple-cache-implementation": "1.0"
},
"require": {
"php": ">= 5.6",
"php": ">= 8.0",
"psr/simple-cache": "^1"
},
"require-dev": {
"codeception/codeception": "^2",
"mindplay/simple-cache": "^1.0",
"cache/integration-tests": "dev-master"
"codeception/codeception": "^5",
"cache/integration-tests": "dev-master",
"codeception/module-asserts": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.suite.dist.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class_name: IntegrationTester
actor: IntegrationTester
modules:
enabled:
- Asserts
18 changes: 9 additions & 9 deletions tests/integration/FileCacheCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public function setGetAndDelete(IntegrationTester $I)
$I->assertSame(null, $this->cache->get("key1"));
$I->assertSame("value2", $this->cache->get("key2"));

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->set("key@", "value1");
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->get("key@");
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->delete("key@");
});
}
Expand Down Expand Up @@ -187,19 +187,19 @@ public function testGetAndSetMultiple(IntegrationTester $I)

$I->assertSame(["key1" => "value1", "key2" => "value2", "key3" => false], $results);

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->getMultiple("Invalid type");
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->setMultiple("Invalid type");
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->setMultiple(["Invalid key@" => "value1"]);
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->getMultiple(["Invalid key@"]);
});
}
Expand All @@ -214,11 +214,11 @@ public function testDeleteMultiple(IntegrationTester $I)

$I->assertSame("value3", $this->cache->get("key3"));

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->deleteMultiple("Invalid type");
});

$I->expectException(InvalidArgumentException::class, function () {
$I->expectThrowable(InvalidArgumentException::class, function () {
$this->cache->deleteMultiple(["Invalid key@"]);
});
}
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/_bootstrap.php

This file was deleted.

0 comments on commit ba75331

Please sign in to comment.