Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: AddAlbumRequestTest #3166

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

test: AddAlbumRequestTest #3166

wants to merge 7 commits into from

Conversation

ppshobi
Copy link
Contributor

@ppshobi ppshobi commented Mar 28, 2025

Just some unit tests

@ppshobi ppshobi requested a review from a team as a code owner March 28, 2025 00:02
{
parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);

$this->albums = new Collection(); // initialize with empty collection to avoid error MergeAlbumsRequest::$albums must not be accessed before initialization
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if i am doing this correctly, I was getting an error

MergeAlbumsRequest::$albums must not be accessed before initialization

when i comment this line and run MerglbRequestTest

@ppshobi ppshobi force-pushed the tests-in-http-requests branch from 4ddab40 to 40d4f92 Compare April 3, 2025 18:55
@ppshobi ppshobi force-pushed the tests-in-http-requests branch from 40d4f92 to 89d0578 Compare April 3, 2025 18:58
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.83%. Comparing base (8ccaf03) to head (89d0578).
Report is 2 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ppshobi ppshobi added the Review: easy Easy review expected: probably just need a quick to go through. label Apr 4, 2025
@ildyria
Copy link
Member

ildyria commented Apr 4, 2025

It took me a bit of time to understand why you wanted those.
image
Looking at the coverage I understand better.

However this is not the best way to do it.
It is way more interesting to directly make "queries" in Feature_v2.
The reason being that you are able to also at the same time cover the missing functions here:
https://app.codecov.io/gh/LycheeOrg/Lychee/blob/master/app%2FHttp%2FControllers%2FGallery%2FAlbumController.php
And the associated actions (which are currently only green because we still test with Legacy endpoints).

{
parent::setUp();
$mockVerify = $this->createMock(VerifyInterface::class);
App::instance(VerifyInterface::class, $mockVerify); // VerifyInterface is talking to DB & that is not needed for Request classes
Copy link
Member

Choose a reason for hiding this comment

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

that is not needed for Request classes

What do you mean ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants