Skip to content

Commit 2d35574

Browse files
committed
Merge branch 'release/3.3.0' into main
2 parents 946c13e + 320d0d3 commit 2d35574

29 files changed

+354
-299
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
php: ['7.4', '8.0']
18+
laravel: ['^8.0']
19+
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
29+
tools: composer:v2
30+
coverage: none
31+
32+
- name: Set Laravel Version
33+
run: composer require "illuminate/support:${{ matrix.laravel }}" --no-update -n
34+
35+
- name: Install dependencies
36+
uses: nick-invision/retry@v1
37+
with:
38+
timeout_minutes: 5
39+
max_attempts: 5
40+
command: composer install --no-suggest --prefer-dist -n -o
41+
42+
- name: Execute tests
43+
run: vendor/bin/phpunit

.travis.yml

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

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,29 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6+
## [3.3.0] - 2021-07-31
7+
8+
### Changed
9+
10+
- Minimum PHP version is now `7.4`.
11+
- Minimum Laravel version is now `8.0`.
12+
- Minimum PHPUnit version is now `9.0`.
13+
14+
### Fixed
15+
16+
- [#19](https://github.com/cloudcreativity/json-api-testing/issues/19) The expected location for the
17+
`assertCreatedWithServerId()` and `assertCreatedWithClientId()` can now be `null`, indicating that the `Location`
18+
header is not expected.
19+
20+
### Deprecated
21+
22+
- The following methods are deprecated and will be removed in `4.0`:
23+
- `assertDeleted()` - use `assertNoContent()` or `assertMetaWithoutData()` depending on your expected response.
24+
- `assertUpdated()` - use `assertNoContent()` or `assertFetchedOne()` depending on your expected response.
25+
626
## [3.2.0] - 2020-11-25
727

8-
###
28+
### Added
929
- Package now supports PHP 8.
1030

1131
## [3.1.0] - 2020-09-09

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^7.2|^8.0",
24+
"php": "^7.4|^8.0",
2525
"ext-json": "*",
26-
"illuminate/support": "^6.0|^7.0|^8.0",
27-
"phpunit/phpunit": "^8.0|^9.0"
26+
"illuminate/support": "^8.0",
27+
"phpunit/phpunit": "^9.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

src/Assert.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
2-
/**
3-
* Copyright 2019 Cloud Creativity Limited
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
namespace CloudCreativity\JsonApi\Testing;

src/Compare.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
2-
/**
3-
* Copyright 2019 Cloud Creativity Limited
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
namespace CloudCreativity\JsonApi\Testing;

src/Concerns/HasDocumentAssertions.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
2-
/**
3-
* Copyright 2019 Cloud Creativity Limited
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
namespace CloudCreativity\JsonApi\Testing\Concerns;

src/Concerns/HasHttpAssertions.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
2-
/**
3-
* Copyright 2019 Cloud Creativity Limited
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
namespace CloudCreativity\JsonApi\Testing\Concerns;
@@ -309,13 +309,13 @@ public function assertFetchedToManyInOrder($expected, bool $strict = true): self
309309
/**
310310
* Assert that a resource was created with a server generated id.
311311
*
312-
* @param string $expectedLocation
313-
* the expected location without the id.
312+
* @param string|null $expectedLocation
313+
* the expected location without the id, or null if no location header is expected.
314314
* @param UrlRoutable|string|int|array $expected
315315
* @param bool $strict
316316
* @return $this
317317
*/
318-
public function assertCreatedWithServerId(string $expectedLocation, $expected, bool $strict = true): self
318+
public function assertCreatedWithServerId(?string $expectedLocation, $expected, bool $strict = true): self
319319
{
320320
$this->document = HttpAssert::assertCreatedWithServerId(
321321
$this->getStatusCode(),
@@ -333,12 +333,13 @@ public function assertCreatedWithServerId(string $expectedLocation, $expected, b
333333
/**
334334
* Assert that a resource was created with a client generated id.
335335
*
336-
* @param string $expectedLocation
336+
* @param string|null $expectedLocation
337+
* the expected location without the id, or null if no location header is expected.
337338
* @param UrlRoutable|string|int|array $expected
338339
* @param bool $strict
339340
* @return $this
340341
*/
341-
public function assertCreatedWithClientId(string $expectedLocation, $expected, bool $strict = true): self
342+
public function assertCreatedWithClientId(?string $expectedLocation, $expected, bool $strict = true): self
342343
{
343344
$this->document = HttpAssert::assertCreatedWithClientId(
344345
$this->getStatusCode(),
@@ -385,6 +386,7 @@ public function assertCreatedNoContent(string $expectedLocation): self
385386
* array representation of the expected resource, or null for a no-content response
386387
* @param bool $strict
387388
* @return $this
389+
* @deprecated 4.0 use not recommended: use `assertNoContent()` or `assertFetchedOne()` instead.
388390
*/
389391
public function assertUpdated(array $expected = null, bool $strict = true): self
390392
{
@@ -411,6 +413,7 @@ public function assertUpdated(array $expected = null, bool $strict = true): self
411413
* the expected top-level meta, or null for no content response.
412414
* @param bool $strict
413415
* @return $this
416+
* @deprecated 4.0 use not recommended: use `assertNoContent() or `assertMetaWithoutData()` instead.
414417
*/
415418
public function assertDeleted(array $expected = null, bool $strict = true): self
416419
{

src/Constraints/EmptyOrMissingList.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
<?php
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
217

318
namespace CloudCreativity\JsonApi\Testing\Constraints;
419

src/Constraints/ExactInDocument.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
2-
/**
3-
* Copyright 2019 Cloud Creativity Limited
2+
/*
3+
* Copyright 2021 Cloud Creativity Limited
44
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
7+
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717

1818
namespace CloudCreativity\JsonApi\Testing\Constraints;

0 commit comments

Comments
 (0)