Skip to content

Commit 92f2ce0

Browse files
authored
Upgrade to PHP 8.1 (#14)
* Updated PHP requirements to >= 8.0 * Updated Codeception to ^5 * Enabled `SecureSocketCest::sendSMTPMessageOverSecureSocket` since it is functional, but added a stopgap in case SSL is not configured correctly since the actual error message is garbled * Rewrote the development guidelines * Removed Travis and added Github Actions
1 parent 2333b01 commit 92f2ce0

25 files changed

+497
-3051
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Codeception tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: ${{matrix.operating-system}}, PHP ${{ matrix.php }}
8+
9+
runs-on: ${{ matrix.operating-system }}
10+
11+
strategy:
12+
matrix:
13+
operating-system: [ ubuntu-latest, ubuntu-20.04 ]
14+
php: [ '8.0', '8.1' ]
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
19+
- name: Setup PHP
20+
uses: nanasess/setup-php@master
21+
with:
22+
php-version: ${{ matrix.php }}
23+
24+
- name: Install dependencies
25+
run: composer install
26+
27+
- name: Start smtp-sink
28+
run: |
29+
sudo apt-get update -qq
30+
sudo apt-get install -y -qq postfix
31+
smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
32+
33+
- name: Run tests
34+
run: php vendor/bin/codecept run

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
/tests/_output
55
/tests/_support/_generated
66
/tests/*.suite.yml
7-
/codeception.yml
7+
!/tests/unit.suite.yml
8+
composer.lock

.scrutinizer.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
language: php
22

33
php:
4-
- 7.1
5-
- 7.2
6-
- 7.3
4+
- 8.0
5+
- 8.1
76

87
before_script:
98
- 'composer update --prefer-source'
@@ -13,8 +12,4 @@ before_install:
1312
- sudo apt-get install -y -qq postfix
1413
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
1514

16-
script: if [ $(phpenv version-name) = "7.0" ]; then vendor/bin/codecept run --coverage-xml; else vendor/bin/codecept run; fi
17-
18-
after_script:
19-
- if [ $(phpenv version-name) = "7.0" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
20-
- if [ $(phpenv version-name) = "7.0" ]; then php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml; fi
15+
script: vendor/bin/codecept run

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kodus/mail
22
==========
33

4-
[![PHP Version](https://img.shields.io/badge/php-7.1%2B-blue.svg)](https://packagist.org/packages/kodus/mail)
4+
[![PHP Version](https://img.shields.io/badge/php-8.0%2B-blue.svg)](https://packagist.org/packages/kodus/mail)
55
[![Build Status](https://travis-ci.org/kodus/mail.svg?branch=master)](https://travis-ci.org/kodus/mail)
66
[![Code Coverage](https://scrutinizer-ci.com/g/kodus/mail/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodus/mail/?branch=master)
77
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodus/mail/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodus/mail/?branch=master)
@@ -119,15 +119,17 @@ a fake mail-service for testing and development, enabling you to see Messages th
119119

120120
To run the integration tests, you will need to set up a local SMTP server for testing.
121121

122-
On Windows, try [Papercut](https://papercut.codeplex.com/) or [SMTP4Dev](http://smtp4dev.codeplex.com/).
122+
To make sure `SecureSocketCest` passes your SMTP server also needs to have TLS support with a SSL certificate.
123123

124-
On Linux, you will likely just have to set up an actual, local SMTP daemon. (see `.travis.yml` for an
125-
example of installing and starting `smtp-sink` which comes with `postfix`.)
124+
It is recommended to use [smtp4dev](https://github.com/rnwood/smtp4dev) since it has cross-platform support and can generate its own self-signed SSL certificate.
125+
126+
When configuring smtp4dev make sure to set `TlsMode` to `StartTls`, this ensures that TLS is only used when the client asks for it, setting it to `ImplicitTls` will likely make all non-TLS tests fail.
127+
128+
When starting the smtp4dev server it should tell you where the generated certificate is stored, you'll need to add this to your systems trusted CA store.
126129

127130
You may need to copy `integration.suite.dist.yml` to `integration.suite.yml` to customize the
128131
SMTP host-name, port-number, etc.
129132

130-
131133
<a name="objectives"></a>
132134
## Objectives
133135

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ coverage:
55
- src/*
66
paths:
77
tests: tests
8-
log: tests/_output
8+
output: tests/_output
99
data: tests/_data
1010
support: tests/_support
1111
envs: tests/_envs
1212
settings:
13-
bootstrap: _bootstrap.php
14-
colors: false
1513
memory_limit: 1024M
1614
extensions:
1715
enabled:

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": ">= 7.1",
15+
"php": ">= 8.0",
1616
"psr/log": "^1"
1717
},
1818
"require-dev": {
19-
"codeception/codeception": "^2"
19+
"codeception/codeception": "^5",
20+
"codeception/module-asserts": "^3.0"
2021
},
2122
"autoload": {
2223
"psr-4": {

0 commit comments

Comments
 (0)