Skip to content

Commit c754ccd

Browse files
committed
Merge branch 'release/2.3.1'
2 parents 6efb529 + ec57c2e commit c754ccd

File tree

5 files changed

+53
-48
lines changed

5 files changed

+53
-48
lines changed

.github/workflows/ci.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
php: [7.2, 7.3, 7.4]
16+
stability: [prefer-lowest, prefer-stable]
17+
18+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Cache dependencies
25+
uses: actions/cache@v1
26+
with:
27+
path: ~/.composer/cache
28+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
coverage: pcov
35+
36+
- name: Install dependencies
37+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
38+
39+
- name: Execute tests
40+
run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose
41+
42+
- name: Upload Code Coverage
43+
run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover

.travis.yml

-46
This file was deleted.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.0
1+
2.3.1

src/Support/ParserCreator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function __construct()
3636
*/
3737
public function parseAgent($agent)
3838
{
39-
return $this->parser->parse($agent);
39+
return $this->parser->parse((string) $agent);
4040
}
4141
}

tests/Support/ParserCreatorTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,12 @@ public function it_returns_a_client_after_parsing_agent()
3939
{
4040
$this->assertInstanceOf(Client::class, $this->parser->parseAgent('SomeAgent'));
4141
}
42+
43+
/**
44+
* @test
45+
*/
46+
public function it_will_parse_a_null_agent_string()
47+
{
48+
$this->assertInstanceOf(Client::class, $this->parser->parseAgent(null));
49+
}
4250
}

0 commit comments

Comments
 (0)