Skip to content

Commit 10c3761

Browse files
committed
Merge branch 'hotfix/1.1.1' into main
2 parents 5836ef9 + c7a6d5c commit 10c3761

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
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+
## [1.1.1] - 2022-02-27
7+
8+
### Fixed
9+
10+
- The Symfony response class can return `false` for the response content. This caused a fatal error when the content was
11+
passed to JSON:API assertions - as the assertion methods type-hint the content as a `string` in version 4 of that
12+
dependency. This has been fixed by adding a `TestResponse::getContent()` method that returns an empty string if the
13+
Symfony method returns `false`.
14+
615
## [1.1.0] - 2022-02-08
716

817
### Added
@@ -17,9 +26,9 @@ All notable changes to this project will be documented in this file. This projec
1726

1827
- The following page assertions will be removed in the next major release. You should use the fluent methods instead to
1928
assert the resources fetched, meta and links. Deprecated methods are:
20-
- `assertFetchedPage()` - use `assertFetchedMany()`, `assertMeta()` and `assertLinks()`.
21-
- `assertFetchedPageInOrder()` - use `assertFetchedManyInOrder()`, `assertMeta()` and `assertLinks()`.
22-
- `assertFetchedEmptyPage()` - use `assertFetchedNone()`, `assertMeta()` and `assertLinks()`.
29+
- `assertFetchedPage()` - use `assertFetchedMany()`, `assertMeta()` and `assertLinks()`.
30+
- `assertFetchedPageInOrder()` - use `assertFetchedManyInOrder()`, `assertMeta()` and `assertLinks()`.
31+
- `assertFetchedEmptyPage()` - use `assertFetchedNone()`, `assertMeta()` and `assertLinks()`.
2332

2433
## [1.0.0] - 2021-07-31
2534

src/TestResponse.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
class TestResponse extends BaseTestResponse
2626
{
27-
2827
use HasHttpAssertions;
2928

3029
/**
@@ -79,6 +78,22 @@ public function getId(): ?string
7978
return $this->jsonApi('/data/id');
8079
}
8180

81+
/**
82+
* Get the response content.
83+
*
84+
* @return string
85+
*/
86+
public function getContent(): string
87+
{
88+
$content = $this->baseResponse->getContent();
89+
90+
if (false === $content) {
91+
return '';
92+
}
93+
94+
return $content;
95+
}
96+
8297
/**
8398
* @return string|null
8499
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy