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

Remove global function imports from tests #1582

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

caendesilva
Copy link
Member

No description provided.

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a6bcd95) 100.00% compared to head (a97f942) 100.00%.

Additional details and impacted files
@@              Coverage Diff              @@
##              master     #1582     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
- Complexity      1746      3492   +1746     
=============================================
  Files            180       360    +180     
  Lines           4723      9446   +4723     
=============================================
+ Hits            4723      9446   +4723     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caendesilva caendesilva added the WTD Calls What The Diff label Feb 22, 2024
Copy link

what-the-diff bot commented Feb 22, 2024

PR Summary

  • Optimization of the code
    In "FileFormatter.php", a condition was added to remove unnecessary global function imports from the test files to streamline the code and reduce redundancy.

  • Code clean up
    Modified several test files and removed unnecessary imports to simplify the code. For example:

    • From test files like "PublishViewsCommandTest.php", "ConfigurableSourceRootsFeatureTest.php", and "HydeExtensionFeatureTest.php", redundant functions "is_dir", "app" and "config" were removed, enhancing readability.

    • Consequences include, but are not limited to, the removal of the "app","array_map","basename","config","collect", "glob", "file_put_contents", "realpath", "array_merge", "strip_tags", "trim", "view", "range", "str_replace", "str_starts_with" from test files such as "HydeServiceProviderTest.php", "NavigationMenuTest.php", "SidebarViewTest.php", "SchemaContractsTest.php", "FeaturedImageViewTest.php", "StylesComponentViewTest.php", "CreatesNewPublicationPageTest.php" and many more.

This long list entails that the PR has made significant strides in code optimization, redundancy removal, and overall code simplification for multiple test files. This helps in maintaining code hygiene and aids in easier understanding and debugging of test files in the future.

@caendesilva caendesilva force-pushed the remove-global-function-imports-from-tests branch from c3df37a to a97f942 Compare February 22, 2024 18:11
@caendesilva caendesilva marked this pull request as ready for review February 22, 2024 18:12
@caendesilva caendesilva merged commit f68daaf into master Feb 22, 2024
19 checks passed
@caendesilva caendesilva deleted the remove-global-function-imports-from-tests branch February 22, 2024 18:14
@caendesilva caendesilva removed the WTD Calls What The Diff label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant