Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

PHPORM-68 Fix partial value un exist validator #24

Closed
wants to merge 20 commits into from

Conversation

GromNaN
Copy link
Owner

@GromNaN GromNaN commented Aug 21, 2023

Fix PHPORM-68

Missed in 3a46876.

@GromNaN GromNaN requested review from jmikola and alcaeus August 21, 2023 09:17
@GromNaN GromNaN force-pushed the presence-verifier branch from a5f354e to 1a59835 Compare August 21, 2023 09:39
alcaeus and others added 19 commits August 22, 2023 10:17
* Skip MySQL tests if database is not available

* Introduce tests namespace
…tests (#6)

* PHPORM-45 Add Query\Builder::toMql() to simplify comprehensive query tests
* Move Query/Builder unit tests to a dedicated test class
…th invalid direction (#7)

* Convert only strings, let the driver fail for int values
* Add more tests on Builder::orderBy
…lications (#12)

* Add header documentation for classes & traits that can be used in applications
* Precise mixed types when possible
…eject invalid array (#10)

The Query\Builder::whereBetween() method can be used like this:

whereBetween('date_field', [min, max])
whereBetween('date_field', collect([min, max]))
whereBetween('date_field', CarbonPeriod)

Laravel allows other formats: the $values array is flatten and the builder assumes there are at least 2 elements and ignore the others. It's a design that can lead to misunderstandings. I prefer to raise an exception when we have incorrect values, rather than trying to guess what the developer would like to do.

Support for CarbonPeriod was fixed in Laravel 10: laravel/framework#46720 because the query builder was taking the 1st 2 values of the iterator instead of the start & end dates.
…$not` (#13)

`Query\Builder::whereNot` was simply ignoring the "not" and breaking the built query.
…$not` (#13) (#15)

`Query\Builder::whereNot` was simply ignoring the "not" and breaking the built query.
- Add tests on query builder methods that don't need to be fixed.
- Throw exception when calling unsupported methods: whereIntegerInRaw, orWhereIntegerInRaw, whereIntegerNotInRaw, orWhereIntegerNotInRaw
- Throw an exception when Query\Builder::where is called with only a column name
- Fix support for % and _ in like expression and escaped \% and \_
- Keep ilike and regexp operators as aliases for like and regex
- Allow /, # and ~ as regex delimiters
- Add functional tests on regexp and not regexp
- Add support for not regex
* PHPORM-35 Add various tests on Model _id

* Add assertion on expected value

* Test _id as array and object

* Remove tests for arrays and objects as identifiers when keyType is string

---------

Co-authored-by: Andreas Braun <[email protected]>
@GromNaN GromNaN force-pushed the presence-verifier branch from 1a59835 to 90fab85 Compare August 22, 2023 09:13
@GromNaN GromNaN force-pushed the presence-verifier branch from 90fab85 to 0213ce3 Compare August 22, 2023 09:14
@GromNaN
Copy link
Owner Author

GromNaN commented Aug 22, 2023

Moved to mongodb/laravel-mongodb#2568

@GromNaN GromNaN closed this Aug 22, 2023
@GromNaN GromNaN deleted the presence-verifier branch August 22, 2023 09:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants