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

[5.4] Soft delete assertion #18328

Merged
merged 3 commits into from
Mar 16, 2017
Merged

[5.4] Soft delete assertion #18328

merged 3 commits into from
Mar 16, 2017

Conversation

browner12
Copy link
Contributor

  • add new method assertion to the InteractsWithDatabase trait
  • create new constraint for soft deletes that checks that deleted_at is not null
  • a couple of tests for the new assertion

- add new method assertion to the `InteractsWithDatabase` trait
- create new constraint for soft deletes that checks that `deleted_at`
is not null
- a couple of tests for the new assertion
@browner12
Copy link
Contributor Author

this is my first foray into the testing parts of the foundation, so suggestions are greatly appreciated.

@GrahamCampbell GrahamCampbell changed the title Soft delete assertion [5.4] Soft delete assertion Mar 14, 2017
order imports by length, not alphabetically
@taylorotwell
Copy link
Member

I kinda go back and forth with this. Part of me thinks its simpler to just do like:

$this->assertEquals(1, DB::table('foo')->where()->whereNotNull('deleted_at')->count());

@taylorotwell
Copy link
Member

Sorry, wrong button :)

@taylorotwell taylorotwell merged commit 29ed5d7 into laravel:5.4 Mar 16, 2017
@browner12
Copy link
Contributor Author

yah, i guess I'm looking at it from the Dusk side of things where everything is trying to be a little more written as you speak it.

I think it comes down to, is it a common enough assertion to wrap it in a nice short method, and I would argue it is.

Thanks,

@browner12 browner12 deleted the soft-delete-assertion branch March 16, 2017 15:41
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