Skip to content

test(admin-controller): add unit tests covering all controller endpoints#2544

Open
cristianscheid wants to merge 2 commits into
masterfrom
test/noid/admin-controller
Open

test(admin-controller): add unit tests covering all controller endpoints#2544
cristianscheid wants to merge 2 commits into
masterfrom
test/noid/admin-controller

Conversation

@cristianscheid

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Refactor testCirclesList() and add coverage for all remaining endpoints in lib/Controller/AdminController.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@cristianscheid cristianscheid self-assigned this Jun 19, 2026
@cristianscheid cristianscheid force-pushed the test/noid/admin-controller branch 2 times, most recently from 1f8ae82 to e3a72bc Compare June 19, 2026 14:38

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it’s the right kind of tests.
You could use assertSame directly on the array instead of each key/value I think.

Comment thread tests/unit/lib/Controller/AdminControllerTest.php Outdated
Comment thread tests/unit/lib/Controller/AdminControllerTest.php Outdated
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the test/noid/admin-controller branch from e3a72bc to 57b7cef Compare June 25, 2026 17:25
…r property

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the test/noid/admin-controller branch from 57b7cef to 5a6eef8 Compare June 25, 2026 17:25
@cristianscheid

cristianscheid commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

I think it’s the right kind of tests. You could use assertSame directly on the array instead of each key/value I think.

@come-nc thank you very much for the review.

The reason I didn't use assertSame on the entire array on some tests like $this->assertSame($result, $circleData) is because the structure returned from CircleService methods is slightly different from the one returned by the AdminController methods. So instead, I compared what I judged the more relevant key/values for each scenario.

Your other suggestions were addressed on commit 5a6eef8

@cristianscheid cristianscheid requested a review from come-nc June 25, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants