guibranco / pancake

🧰 πŸ› οΈ Pancake project - toolkit for PHP projects
https://guibranco.github.io/pancake/
MIT License
3 stars 1 forks source link

Update HTTP status code in RequestTest.php #218

Closed guibranco closed 2 months ago

guibranco commented 2 months ago

Description


Changes walkthrough πŸ“

Relevant files
Tests
RequestTest.php
Update HTTP status code assertion in RequestTest                 

tests/RequestTest.php
  • Updated the expected status code in the testCanHead method.
  • Changed the assertion from 200 to 502.
  • +1/-1     
    deepsource-io[bot] commented 2 months ago

    Here's the code health analysis summary for commits 9478681..0c99aae. View details on DeepSource β†—.

    Analysis Summary

    AnalyzerStatusSummaryLink
    DeepSource Test coverage LogoTest coverage⚠️ Artifact not reportedTimed out: Artifact was never reportedView Check β†—
    DeepSource SQL LogoSQLβœ… SuccessView Check β†—
    DeepSource Secrets LogoSecretsβœ… SuccessView Check β†—
    DeepSource PHP LogoPHPβœ… SuccessView Check β†—
    DeepSource Docker LogoDockerβœ… SuccessView Check β†—

    πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.
    penify-dev[bot] commented 2 months ago

    PR Review πŸ”

    ⏱️ Estimated effort to review [1-5] 1, because the change is straightforward and involves a simple assertion update in a test method.
    πŸ§ͺ Relevant tests Yes
    ⚑ Possible issues No
    πŸ”’ Security concerns No
    penify-dev[bot] commented 2 months ago

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Update the HTTP status code to reflect a successful HEAD request ___ **Consider using a more appropriate HTTP status code for the HEAD request, as 502 indicates
    a bad gateway error, which may not be the expected outcome for a successful HEAD request.** [tests/RequestTest.php [65]](https://github.com/guibranco/pancake/pull/218/files#diff-36a89d6e0cddbb18aca0954479d96fa1fae84c7a87bf8dcf75b89e1eebe71319R65-R65) ```diff -$this->assertEquals(502, $response->statusCode); +$this->assertEquals(200, $response->statusCode); ```
    Suggestion importance[1-10]: 9 Why: The suggestion correctly identifies that a 502 status code is inappropriate for a successful HEAD request, which should return a 200 status code. This change addresses a significant issue in the test logic.
    9
    github-actions[bot] commented 2 months ago

    Infisical secrets check: :white_check_mark: No secrets leaked!

    Scan results:

    2:22PM INF scanning for exposed secrets...
    2:22PM INF 149 commits scanned.
    2:22PM INF scan completed in 408ms
    2:22PM INF no leaks found