Skip to content

Commit 5b28e2f

Browse files
committed
Cleanup
1 parent afec915 commit 5b28e2f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ use Mercure\TestSuite\MockPublisher;
814814
// In your test
815815
public function testPublishing(): void
816816
{
817+
// Se the mock publisher
817818
Publisher::setInstance(new MockPublisher());
818819

819820
// Test your code that publishes updates

src/TestSuite/MockPublisher.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ class MockPublisher implements PublisherInterface
1919
*/
2020
private array $updates = [];
2121

22-
private string $hubUrl;
23-
2422
/**
2523
* Constructor
2624
*
2725
* @param string $hubUrl Hub URL to return
2826
*/
29-
public function __construct(string $hubUrl = 'http://localhost:3000/.well-known/mercure')
30-
{
31-
$this->hubUrl = $hubUrl;
27+
public function __construct(
28+
protected readonly string $hubUrl = 'http://localhost:3000/.well-known/mercure',
29+
) {
3230
}
3331

3432
/**

0 commit comments

Comments
 (0)