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

Implemented artisan test case #15286

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Implemented artisan test case #15286

merged 2 commits into from
Aug 13, 2024

Conversation

marcusmoore
Copy link
Collaborator

Description

This PR implements an incomplete test from #15266. The problem was we were assigning $this->artisan to a variable...

The problem is that when we assign $this->artisan to a variable, the command is not actually run until the test method finishes. Because of this, any assertions we make about what the command should have done are going to fail. The command hasn't run yet!

Heads up @uberbrady, I cleaned up the second test case but it looks like it was actually failing. It looks like this return is preventing the behavior the test expects:

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Copy link

what-the-diff bot commented Aug 13, 2024

PR Summary

  • Updated Namespace in FixupAssignedToAssignedTypeTest.php
    The change establishes the proper namespace for the test file, enhancing the code organization.

  • Updated testEmptyAssignedType() Function
    The function was updated to invoke a command instead of simply marking the test as incomplete. This means, rather than just stating that the test wasn't done, it's now performing an actual test operation and ensures that the command runs without errors.

  • Cleaned Up testInvalidAssignedTo() Function
    Unused commented code was removed from the function, making the function cleaner and easier to read.

  • Updated Assertions in testEmptyAssignedType() and testInvalidAssignedTo() Functions
    The assertions, which check if the tests are successful, have been updated in these functions. They now verify the current state of the 'asset' record after updates are made, providing a more accurate test result.

@snipe
Copy link
Owner

snipe commented Aug 13, 2024

Awesome, ty!

@snipe snipe merged commit 74e7b1c into snipe:develop Aug 13, 2024
7 of 9 checks passed
@marcusmoore marcusmoore deleted the test-updates branch August 13, 2024 19:47
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.

2 participants