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

Cleanup and tests #2567

Merged
merged 19 commits into from
Aug 22, 2023
Merged

Cleanup and tests #2567

merged 19 commits into from
Aug 22, 2023

Commits on Jun 29, 2023

  1. PHPORM-39: Add namespace for tests directory (mongodb#2)

    * Skip MySQL tests if database is not available
    
    * Introduce tests namespace
    alcaeus committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    ea2da7a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b6e8a44 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. Configuration menu
    Copy the full SHA
    bc364b5 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. PHPORM-45 Add Query\Builder::toMql() to simplify comprehensive query …

    …tests (mongodb#6)
    
    * PHPORM-45 Add Query\Builder::toMql() to simplify comprehensive query tests
    * Move Query/Builder unit tests to a dedicated test class
    GromNaN committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    60a22f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    843904b View commit details
    Browse the repository at this point in the history
  3. PHPORM-46 Throw an exception when Query\Builder::orderBy() is used wi…

    …th invalid direction (mongodb#7)
    
    * Convert only strings, let the driver fail for int values
    * Add more tests on Builder::orderBy
    GromNaN committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    8562a4b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4658d54 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. Configuration menu
    Copy the full SHA
    78319d4 View commit details
    Browse the repository at this point in the history
  2. Add header documentation for classes & traits that can be used in app…

    …lications (mongodb#12)
    
    * Add header documentation for classes & traits that can be used in applications
    * Precise mixed types when possible
    GromNaN committed Jul 13, 2023
    Configuration menu
    Copy the full SHA
    bd86f85 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. PHPORM-47 Improve Builder::whereBetween to support CarbonPeriod and r…

    …eject invalid array (mongodb#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.
    GromNaN committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    cf103ba View commit details
    Browse the repository at this point in the history
  2. PHPORM-49 Implement Query\Builder::whereNot by encapsulating into `…

    …$not` (mongodb#13)
    
    `Query\Builder::whereNot` was simply ignoring the "not" and breaking the built query.
    GromNaN committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    9d9c7c8 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. PHPORM-49 Implement Query\Builder::whereNot by encapsulating into `…

    …$not` (mongodb#13) (mongodb#15)
    
    `Query\Builder::whereNot` was simply ignoring the "not" and breaking the built query.
    GromNaN committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    52c0ea3 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Configuration menu
    Copy the full SHA
    9cbadea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    03c58ea View commit details
    Browse the repository at this point in the history
  3. PHPORM-33 Add tests on Query\Builder methods (mongodb#14)

    - 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
    GromNaN committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    b0b796c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2824dc4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3a46876 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. PHPORM-53 Fix and test like and regex operators (mongodb#17)

    - 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
    GromNaN committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    2319d53 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. PHPORM-35 Add various tests on Model _id types (mongodb#22)

    * 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 <git@alcaeus.org>
    GromNaN and alcaeus committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    9f1f8f3 View commit details
    Browse the repository at this point in the history