Skip to content

Commit c00d1d2

Browse files
authored
Merge pull request #56 from understand/feature/gh-actions-and-compatibility
Feature/gh actions and compatibility
2 parents 13aa46a + fbbd71b commit c00d1d2

File tree

4 files changed

+81
-79
lines changed

4 files changed

+81
-79
lines changed

.github/workflows/run-test.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on: push
2+
name: run-tests
3+
jobs:
4+
php-tests:
5+
runs-on: ubuntu-latest
6+
7+
strategy:
8+
matrix:
9+
php: [8.0, 7.4, 7.3, 7.2]
10+
laravel: [8.*, 7.*, 6.*, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
11+
12+
include:
13+
- laravel: 8.*
14+
testbench: 6.*
15+
- laravel: 7.*
16+
testbench: 5.*
17+
- laravel: 6.*
18+
testbench: 4.*
19+
- laravel: 5.8.*
20+
testbench: 3.8.*
21+
- laravel: 5.7.*
22+
testbench: 3.7.*
23+
- laravel: 5.6.*
24+
testbench: 3.6.*
25+
- laravel: 5.5.*
26+
testbench: 3.5.*
27+
28+
exclude:
29+
- laravel: 8.*
30+
php: 7.2
31+
- laravel: 5.8.*
32+
php: 8.0
33+
- laravel: 5.7.*
34+
php: 8.0
35+
- laravel: 5.6.*
36+
php: 8.0
37+
- laravel: 5.5.*
38+
php: 8.0
39+
- laravel: 5.5.*
40+
php: 7.4
41+
42+
name: P${{ matrix.php }} - L${{ matrix.laravel }}
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v2
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: ${{ matrix.php }}
52+
extensions: curl
53+
coverage: none
54+
55+
- name: Install dependencies
56+
run: |
57+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
58+
composer update --prefer-dist --no-interaction
59+
60+
- name: Execute tests
61+
run: vendor/bin/phpunit

.travis.yml

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

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "understand/understand-laravel",
3-
"description": "Laravel 5, 6 and 7 service provider for Understand.io",
3+
"description": "Laravel 5, 6, 7 and 8 service provider for Understand.io",
44
"keywords": ["laravel", "understand.io", "understand", "logs", "laravel 5", "Laravel 6"],
55
"license": "MIT",
66
"authors": [
@@ -10,13 +10,13 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=5.5.0",
13+
"php": "^5.5 || ^7.0 || ^8.0",
1414
"ext-curl": "*",
15-
"illuminate/support": "~5.0|~6.0|~7.0|~8.0"
15+
"illuminate/support": "^5.0 || ^6.0 || ^7.0 || ^8.0"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "~6.0",
19-
"orchestra/testbench": "^3.5",
18+
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0",
19+
"orchestra/testbench": "3.* || 4.* || 5.* || 6.*",
2020
"mockery/mockery": "^1.2"
2121
},
2222
"autoload": {

tests/ExceptionEncoderTest.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testStackTraceSerializationWithoutArgs()
5555

5656
$this->assertEmpty($stackTraceArray[0]['args']);
5757
}
58-
58+
5959
public function testUndefinedFunctionIndex()
6060
{
6161
$stackTrace = debug_backtrace();
@@ -66,31 +66,31 @@ public function testUndefinedFunctionIndex()
6666

6767
$this->assertEmpty($stackTraceArray[0]['function']);
6868
}
69-
69+
7070
public function testIncompleteClass()
7171
{
7272
$catched = false;
73-
74-
try
73+
74+
try
7575
{
7676
// trigger invalid argument exception
7777
// to test __PHP_Incomplete_Class argument serialisation in `stackTraceToArray`
7878
// `Object of class __PHP_Incomplete_Class could not be converted to string`
7979
$incompleteObject = unserialize('O:1:"a":1:{s:5:"value";s:3:"100";}');
8080

8181
with(new Understand\UnderstandLaravel5\ExceptionEncoder())->exceptionToArray($incompleteObject);
82-
82+
8383
$this->fail('Should never be reached');
84-
}
85-
catch (\Exception $exception)
84+
}
85+
catch (Exception $exception)
8686
{
8787
$this->assertIncompleteClassStackTrace($exception, 0);
8888
$catched = true;
8989
}
90-
90+
9191
$this->assertTrue($catched);
9292
}
93-
93+
9494
/**
9595
* @param object $exception
9696
* @param integer $index
@@ -101,7 +101,12 @@ protected function assertIncompleteClassStackTrace($exception, $index)
101101
$encoder = new Understand\UnderstandLaravel5\ExceptionEncoder();
102102
$stackTraceArray = $encoder->stackTraceToArray($exception->getTrace());
103103

104-
if (Str::startsWith(phpversion(), ['7.2', '7.3']))
104+
if (Str::startsWith(phpversion(), ['7.4', '8.0'])) {
105+
// As of PHP 7.4 Exception::getTrace()
106+
// no longer contains "args" keys by default
107+
$this->assertSame([], $stackTraceArray[$index]['args']);
108+
}
109+
else if (Str::startsWith(phpversion(), ['7.2', '7.3']))
105110
{
106111
$this->assertSame('__PHP_Incomplete_Class', $stackTraceArray[$index]['args'][0]);
107112
}

0 commit comments

Comments
 (0)