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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep Rules] Create unit tests for inventory log creation and update #76

Merged
merged 2 commits into from
May 30, 2024

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Mar 11, 2024

PR Feedback (click)

  • 馃憤 Sweep Did Well
  • 馃憥 Sweep Needs Improvement

I created this PR to address this rule:

"All new business logic should have corresponding unit tests."

Description

This PR adds unit tests for the create and update methods in the ProductController class. These unit tests ensure that the creation and update of inventory logs are correctly implemented and functioning as expected.

Summary of Changes

  • Created a new unit test file tests/Unit/Controllers/ProductControllerTest.php for testing the ProductController class.
  • Modified the ProductControllerTest.php file to include necessary imports and class definition.
  • Added a test method testCreateMethodCreatesInventoryLogs to test the creation of inventory logs when creating a product.
  • Added a test method testUpdateMethodUpdatesInventoryLogs to test the update of inventory logs when updating a product.
  • Mocked the necessary dependencies and asserted that the inventory logs are correctly created and updated in the database.

Please review and merge this PR to ensure proper testing of the inventory log creation and update functionality.

Copy link
Contributor Author

sweep-ai bot commented Mar 11, 2024

Rollback Files For Sweep

  • Rollback changes to tests/Unit/Controllers/ProductControllerTest.php
  • Rollback changes to tests/Unit/Controllers/ProductControllerTest.php
  • Rollback changes to tests/Unit/Controllers/ProductControllerTest.php
  • Rollback changes to tests/Unit/Controllers/ProductControllerTest.php

@sweep-ai sweep-ai bot added the sweep label Mar 11, 2024
@curtisdelicata curtisdelicata merged commit 38272c2 into main May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant