Skip to content

add model assertion that two models are related #2

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

Merged
merged 7 commits into from
Mar 10, 2021
Merged

add model assertion that two models are related #2

merged 7 commits into from
Mar 10, 2021

Conversation

Gummibeer
Copy link
Member

@Gummibeer Gummibeer commented Jan 16, 2021

solves #1

\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertRelated($post, $comment, 'comments');
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertRelationship(
    $post, 
    \App\Models\Comment::class, 
    'comments', 
    \Illuminate\Database\Eloquent\Relations\HasMany::class
);

@Gummibeer Gummibeer self-assigned this Jan 16, 2021
@Gummibeer
Copy link
Member Author

@aidan-casey sorry for the long delay.
I've updated the assertion to be able to handle all of our use-cases.
Do you want to check it if it's now doing what you wanted?^^

@aidan-casey
Copy link
Contributor

aidan-casey commented Mar 9, 2021

@aidan-casey sorry for the long delay.
I've updated the assertion to be able to handle all of our use-cases.
Do you want to check it if it's now doing what you wanted?^^

Likewise, sorry for the long delay! What you have here is exactly the functionality I was thinking of. I think it fits the use case well.

Thanks for your work on this!

@Gummibeer Gummibeer merged commit ee9a6c2 into main Mar 10, 2021
@Gummibeer Gummibeer deleted the issue-1 branch March 10, 2021 10:43
@Gummibeer
Copy link
Member Author

https://github.com/Astrotomic/phpunit-assertions/releases/tag/0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants