Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e9c896f
Initial plan
Copilot Nov 14, 2025
0f4a4c5
Merge latest master with updated instructions
Copilot Nov 15, 2025
d8672ab
Replace withConsecutive in ItemApiControllerTest.php
Copilot Nov 15, 2025
09b81e3
Replace withConsecutive in 7 more test files
Copilot Nov 15, 2025
89112da
Replace withConsecutive in ItemControllerTest and PageControllerTest
Copilot Nov 15, 2025
20877d9
Replace withConsecutive in NewsMapperTest
Copilot Nov 15, 2025
84a8f3b
Replace withConsecutive in FeedServiceTest and StatusServiceTest
Copilot Nov 15, 2025
71886cc
Work in progress on FolderMapperTest
Copilot Nov 15, 2025
461579a
Complete ItemMapperAfterTest - replace all 14 withConsecutive instances
Copilot Nov 15, 2025
7067373
Complete FolderMapperTest - replace all 14 remaining withConsecutive
Copilot Nov 15, 2025
aeab89a
Work in progress on FeedMapperTest - 3 of 20 instances replaced
Copilot Nov 15, 2025
0ce23e5
Fix StatusServiceTest and FeedServiceTest optional parameters
Copilot Nov 15, 2025
546b695
Complete FeedMapperTest - replace all 20 withConsecutive instances
Copilot Nov 15, 2025
921eb10
Complete ItemMapperTest - replace all 21 withConsecutive instances
Copilot Nov 15, 2025
61b8c04
Complete ItemMapperPaginatedTest - ALL 48 withConsecutive instances r…
Copilot Nov 15, 2025
a0723e4
Fix test failures - handle optional parameters and variable shadowing
Copilot Nov 15, 2025
c5f2db4
Fix more variable shadowing issues in mapper tests
Copilot Nov 15, 2025
cb1adce
Fix all remaining test failures - ALL TESTS PASSING! ✅
Copilot Nov 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Unreleased
## [28.x.x]
### Changed

- Replace deprecated PHPUnit `withConsecutive` method to prepare for PHPUnit 10 upgrade

Check failure on line 10 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'PHPUnit'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'PHPUnit'?", "location": {"path": "CHANGELOG.md", "range": {"start": {"line": 10, "column": 70}}}, "severity": "ERROR"}

Check failure on line 10 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'PHPUnit'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'PHPUnit'?", "location": {"path": "CHANGELOG.md", "range": {"start": {"line": 10, "column": 70}}}, "severity": "ERROR"}

### Fixed

Expand Down
52 changes: 30 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion tests/Unit/Command/ExploreGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,18 @@ public function testFailingFeed()
->with('votes')
->willReturn(100);

$expectedCalls = [
['<error>Failed to fetch feed info:</error>', 0],
['Failure', 0]
];
$callIndex = 0;

$this->consoleOutput->expects($this->exactly(2))
->method('writeln')
->withConsecutive(['<error>Failed to fetch feed info:</error>'], ['Failure']);
->willReturnCallback(function (...$args) use (&$expectedCalls, &$callIndex) {
$this->assertEquals($expectedCalls[$callIndex], $args);
$callIndex++;
});

$result = $this->command->run($this->consoleInput, $this->consoleOutput);
$this->assertSame(1, $result);
Expand Down
28 changes: 20 additions & 8 deletions tests/Unit/Command/ShowFeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ public function testValid()
->with('feed', true, 'user', 'user')
->willReturn([['feed'], [['items']]]);

$expectedCalls = [
["Feed: [\n \"feed\"\n]", 0], // writeln includes verbosity level
["Items: [\n [\n \"items\"\n ]\n]", 0]
];
$callIndex = 0;

$this->consoleOutput->expects($this->exactly(2))
->method('writeln')
->withConsecutive(
["Feed: [\n \"feed\"\n]"],
["Items: [\n [\n \"items\"\n ]\n]"]
);
->willReturnCallback(function (...$args) use (&$expectedCalls, &$callIndex) {
$this->assertEquals($expectedCalls[$callIndex], $args);
$callIndex++;
});

$result = $this->command->run($this->consoleInput, $this->consoleOutput);
$this->assertSame(0, $result);
Expand Down Expand Up @@ -109,12 +115,18 @@ public function testInValid()
->with('feed', true, 'user', 'user')
->will($this->throwException(new ServiceNotFoundException('test')));

$expectedCalls = [
['<error>Failed to fetch feed info:</error>', 0], // writeln includes verbosity level
['test', 0]
];
$callIndex = 0;

$this->consoleOutput->expects($this->exactly(2))
->method('writeln')
->withConsecutive(
['<error>Failed to fetch feed info:</error>'],
['test']
);
->willReturnCallback(function (...$args) use (&$expectedCalls, &$callIndex) {
$this->assertEquals($expectedCalls[$callIndex], $args);
$callIndex++;
});

$result = $this->command->run($this->consoleInput, $this->consoleOutput);
$this->assertSame(1, $result);
Expand Down
14 changes: 12 additions & 2 deletions tests/Unit/Controller/ExportControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,20 @@ public function testGetAllArticles()
->method('findAllForUser')
->with('user')
->will($this->returnValue($feeds));

$expectedCalls = [
['user', ['unread' => false, 'starred' => true]],
['user', ['unread' => true]]
];
$returns = [$articles, []];
$callIndex = 0;

$this->itemService->expects($this->exactly(2))
->method('findAllForUser')
->withConsecutive(['user', ['unread' => false, 'starred' => true]], ['user', ['unread' => true]])
->willReturnOnConsecutiveCalls($articles, []);
->willReturnCallback(function (...$args) use (&$expectedCalls, &$returns, &$callIndex) {
$this->assertEquals($expectedCalls[$callIndex], $args);
return $returns[$callIndex++];
});


$return = $this->controller->articles();
Expand Down
16 changes: 11 additions & 5 deletions tests/Unit/Controller/FeedControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,19 @@ public function testIndexHighestItemIdExists()
*/
private function activeInitMocks($id, $type): void
{
$expectedCalls = [
[$this->uid, $this->appName, 'lastViewedFeedId', ''],
[$this->uid, $this->appName, 'lastViewedFeedType', '']
];
$returns = [$id, $type];
$callIndex = 0;

$this->settings->expects($this->exactly(2))
->method('getUserValue')
->withConsecutive(
[$this->uid, $this->appName, 'lastViewedFeedId'],
[$this->uid, $this->appName, 'lastViewedFeedType']
)
->willReturnOnConsecutiveCalls($id, $type);
->willReturnCallback(function (...$args) use (&$expectedCalls, &$returns, &$callIndex) {
$this->assertEquals($expectedCalls[$callIndex], $args);
return $returns[$callIndex++];
});
}


Expand Down
Loading
Loading