DirectoryTree / LdapRecord-Laravel

Multi-domain LDAP Authentication & Management for Laravel.
https://ldaprecord.com/docs/laravel/v3
MIT License
492 stars 51 forks source link

Emulation delete #560

Closed cheesegrits closed 10 months ago

cheesegrits commented 1 year ago

While writing some tests for my app using the emulator I couldn't get my detach() tests to work, and tracked it down to the remove() method in EmulatesModelQueries() being broken. Wasn't entirely sure what that broken line was intended to test, whether just the attribute name exists, or the attribute value exists in the named attribute, so went with testing the attribute exists. Lmk if it needs to test for the value existing.

Also added a test for it, as none of the tests exercised remove(). Lmk if you'd prefer that to be moved into a separate test.

Side notes ...

There doesn't seem to be a usable editor code style included in the project, so I had to manually twiddle settings in PHPStorm to un-break some of the formatting I broke in the first commit. Maybe include a pint.json?

The .phpunit.cache has gotten included in git, probably the cache folder name changed at some point. I added it to .gitignore, but of course that doesn't remove previously committed files.

I added .idea to gitignore, for us PHPStorm folk.

cheesegrits commented 1 year ago

LOL, I just noticed someone else just submitted a PR for this exact bug.

Oh well, I had fun figuring out how the emulator works. :)