Skip to content

Commit 052755f

Browse files
authored
Merge pull request #2 from ingenerator/php74-compat
Support php7.4 and test using Github actions
2 parents 548787f + b8071da commit 052755f

File tree

12 files changed

+303
-244
lines changed

12 files changed

+303
-244
lines changed

.github/workflows/test.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Run tests
2+
on:
3+
push:
4+
branches:
5+
# Only mainline branches, features etc are covered on the pull_request trigger
6+
- '*.x'
7+
pull_request:
8+
9+
jobs:
10+
run-tests:
11+
runs-on: ubuntu-latest
12+
name: Run tests
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php_version:
17+
- '7.4'
18+
dependencies:
19+
- 'default'
20+
21+
steps:
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php_version }}
26+
tools: composer:v2
27+
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: |
34+
echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
- uses: actions/cache@v2
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-composer-${{ matrix.dependencies }}
41+
42+
- name: Install composer dependencies
43+
env:
44+
DEPENDENCIES: ${{ matrix.dependencies }}
45+
run: |
46+
if [ $DEPENDENCIES == 'lowest' ]
47+
then
48+
composer update --prefer-lowest --no-interaction --no-progress
49+
else
50+
composer install --no-interaction --no-progress
51+
fi
52+
53+
- name: Run koharness
54+
run: |
55+
vendor/bin/koharness
56+
57+
- name: Run unit tests
58+
run: |
59+
vendor/bin/phpspec run

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/.vagrant
21
/vendor
32
/bin
43
/koharness_bootstrap.php

.travis.yml

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

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
66

7+
## 1.1.0 / 2020-11-02
8+
* Support php 7.4
9+
710
## 1.0.0 / 2019-04-03
811
* Drop support for PHP <=5.5
912
* Ensure support on php7.2

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Pigeonhole - clean flash message management for Kohana
22

33
[![License](https://poser.pugx.org/ingenerator/pigeonhole/license.svg)](https://packagist.org/packages/ingenerator/pigeonhole)
4-
[![Master Build Status](https://travis-ci.org/ingenerator/pigeonhole.png?branch=master)](https://travis-ci.org/ingenerator/pigeonhole)
4+
55
[![Latest Stable Version](https://poser.pugx.org/ingenerator/pigeonhole/v/stable.svg)](https://packagist.org/packages/ingenerator/pigeonhole)
66
[![Total Downloads](https://poser.pugx.org/ingenerator/pigeonhole/downloads.svg)](https://packagist.org/packages/ingenerator/pigeonhole)
77
[![Latest Unstable Version](https://poser.pugx.org/ingenerator/pigeonhole/v/unstable.svg)](https://packagist.org/packages/ingenerator/pigeonhole)
@@ -16,7 +16,7 @@ don't use the "extra" composer config option.
1616

1717
```json
1818
{
19-
"require": {"ingenerator/pigeonhole": "0.1.*@dev"},
19+
"require": {"ingenerator/pigeonhole": "^1.0"},
2020
"extra": {"installer-paths":{"vendor/{$vendor}/{$name}":["type:kohana-module"]}}
2121
}
2222
```
@@ -108,7 +108,7 @@ $message = new \Ingenerator\Pigeonhole\Message\KohanaMessage(
108108
## Testing and developing
109109

110110
pigeonhole has a suite of [PhpSpec](http://phpspec.net) specifications. You'll need a skeleton Kohana application to
111-
run them, you can use [koharness](https://github.com/ingenerator/koharness) to create one. See [travis.yml](travis.yml) for
111+
run them, you can use [koharness](https://github.com/ingenerator/koharness) to create one. See [test.yml](.github/workflows/test.yml) for
112112
the build steps required.
113113

114114
Contributions will only be accepted if they are accompanied by well structured specs. Installing with composer should

composer.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.2",
17-
"kohana/core": "3.3.*"
16+
"php": "^7.4",
17+
"ingenerator/kohana-core": "^4.7"
1818
},
1919
"require-dev": {
20-
"kohana/koharness": "*@dev",
21-
"phpspec/phpspec": "^2.0"
20+
"kohana/koharness": "dev-master",
21+
"phpspec/phpspec": "^6.1"
2222
},
23+
"repositories": [
24+
{
25+
"type": "composer",
26+
"url": "https://php-packages.ingenerator.com"
27+
}
28+
],
2329
"suggest": {
2430
"zeelot/kohana-dependencies": "Service container for Kohana"
2531
},
@@ -32,14 +38,12 @@
3238
"spec\\": "spec"
3339
}
3440
},
35-
"bin": [],
3641
"extra": {
3742
"branch-alias": {
3843
"dev-master": "0.1.x-dev"
3944
}
4045
},
4146
"config": {
42-
"bin-dir": "bin",
4347
"preferred-install": "dist"
4448
}
4549
}

koharness.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
2-
// Configuration for koharness - builds a standalone skeleton Kohana app for running specs
3-
return array(
4-
'modules' => array(
5-
'pigeonhole' => __DIR__,
6-
)
7-
);
2+
return [
3+
'syspath' => __DIR__.'/vendor/ingenerator/kohana-core',
4+
'modules' => [
5+
'pigeonhole' => __DIR__,
6+
],
7+
];

spec/Ingenerator/Pigeonhole/Message/KohanaMessageSpec.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace spec\Ingenerator\Pigeonhole\Message;
44

5-
use spec\ObjectBehavior;
6-
use Prophecy\Argument;
75
use Ingenerator\Pigeonhole\Message;
6+
use Ingenerator\Pigeonhole\Message\KohanaMessage;
7+
use spec\ObjectBehavior;
88

99
class KohanaMessageSpec extends ObjectBehavior
1010
{
11-
/**
12-
* @var \Ingenerator\Pigeonhole\Message\KohanaMessage
13-
*/
14-
protected $subject;
11+
/**
12+
* @var KohanaMessage
13+
*/
14+
protected $subject;
1515

16-
function it_is_initializable()
17-
{
18-
$this->beConstructedWith('foo', 'bar', array(), Message::SUCCESS);
19-
$this->subject->shouldHaveType('Ingenerator\Pigeonhole\Message\KohanaMessage');
20-
}
16+
function it_is_initializable()
17+
{
18+
$this->beConstructedWith('foo', 'bar', [], Message::SUCCESS);
19+
$this->subject->shouldHaveType(KohanaMessage::class);
20+
}
2121

2222
}

spec/Ingenerator/Pigeonhole/Message/ValidationMessageSpec.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22

33
namespace spec\Ingenerator\Pigeonhole\Message;
44

5+
use Ingenerator\Pigeonhole\Message\ValidationMessage;
56
use spec\ObjectBehavior;
6-
use Prophecy\Argument;
7+
use Validation;
78

89
class ValidationMessageSpec extends ObjectBehavior
910
{
1011
/**
11-
* @var \Ingenerator\Pigeonhole\Message\ValidationMessage
12+
* @var ValidationMessage
1213
*/
1314
protected $subject;
14-
15-
/**
16-
* @param \Validation $validation
17-
*/
18-
function let($validation)
15+
16+
function it_is_initializable()
1917
{
20-
$this->beConstructedWith($validation, 'messages');
21-
$validation->errors('messages')->willReturn(array());
18+
$this->subject->shouldHaveType(ValidationMessage::class);
2219
}
2320

24-
function it_is_initializable()
21+
/**
22+
* @param Validation $validation
23+
*/
24+
function its_message_is_the_kohana_validation_errors(Validation $validation)
2525
{
26-
$this->subject->shouldHaveType('Ingenerator\Pigeonhole\Message\ValidationMessage');
26+
$this->beConstructedWith($validation, 'forms/foo');
27+
$validation->errors('forms/foo')->willReturn(['field' => 'field must not be empty', 'other' => 'other is bad']);
28+
$this->subject->message->shouldBe('field must not be empty'.PHP_EOL.'other is bad');
2729
}
2830

2931
/**
30-
* @param \Validation $validation
32+
* @param Validation $validation
3133
*/
32-
function its_message_is_the_kohana_validation_errors($validation)
34+
function let(Validation $validation)
3335
{
34-
$this->beConstructedWith($validation, 'forms/foo');
35-
$validation->errors('forms/foo')->willReturn(array('field' => 'field must not be empty', 'other' => 'other is bad'));
36-
$this->subject->message->shouldBe('field must not be empty'.PHP_EOL.'other is bad');
36+
$this->beConstructedWith($validation, 'messages');
37+
$validation->errors('messages')->willReturn([]);
3738
}
3839
}

0 commit comments

Comments
 (0)