Skip to content

Commit 59176ba

Browse files
authored
chore: style improvements for conformance tests (GoogleCloudPlatform#74)
1 parent ce2caaa commit 59176ba

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

.github/workflows/conformance.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
php-version: [7.2, 7.3, 7.4]
16+
name: PHP ${{ matrix.php-version }} Conformance Test
1617
steps:
1718
- name: Checkout code
1819
uses: actions/checkout@v2

.github/workflows/unit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
operating-system: [ubuntu-latest]
1313
php-versions: ['7.2', '7.3', '7.4']
14-
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
14+
name: PHP ${{ matrix.php-versions }} Unit Test
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v2

src/CloudEvent.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
namespace Google\CloudFunctions;
2020

21-
class CloudEvent implements \JsonSerializable
21+
use JsonSerializable;
22+
23+
class CloudEvent implements JsonSerializable
2224
{
2325
// Required Fields
2426
private $id;

tests/CloudEventTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ class CloudEventTest extends TestCase
2929
public function testJsonSerialize()
3030
{
3131
$event = new CloudEvent(
32-
'1413058901901494',
33-
'//pubsub.googleapis.com/projects/MY-PROJECT/topics/MY-TOPIC',
34-
'1.0',
35-
'com.google.cloud.pubsub.topic.publish',
36-
'application/json',
37-
'type.googleapis.com/google.logging.v2.LogEntry',
38-
'My Subject',
39-
'2020-12-08T20:03:19.162Z',
40-
[
41-
"message" => [
42-
"data" => "SGVsbG8gdGhlcmU=",
43-
"messageId" => "1408577928008405",
44-
"publishTime" => "2020-08-06T22:31:14.536Z"
45-
],
46-
"subscription" => "projects/MY-PROJECT/subscriptions/MY-SUB"
47-
]
32+
'1413058901901494',
33+
'//pubsub.googleapis.com/projects/MY-PROJECT/topics/MY-TOPIC',
34+
'1.0',
35+
'com.google.cloud.pubsub.topic.publish',
36+
'application/json',
37+
'type.googleapis.com/google.logging.v2.LogEntry',
38+
'My Subject',
39+
'2020-12-08T20:03:19.162Z',
40+
[
41+
"message" => [
42+
"data" => "SGVsbG8gdGhlcmU=",
43+
"messageId" => "1408577928008405",
44+
"publishTime" => "2020-08-06T22:31:14.536Z"
45+
],
46+
"subscription" => "projects/MY-PROJECT/subscriptions/MY-SUB"
47+
]
4848
);
4949

5050
$want = '{

0 commit comments

Comments
 (0)