-
-
Notifications
You must be signed in to change notification settings - Fork 55
fix(#474): support usage of arithmetic expressions in mathematical functions #475
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
Conversation
WalkthroughThis PR modifies AST node pattern mapping in arithmetic functions from 'ArithmeticPrimary' to 'SimpleArithmeticExpression', enabling these functions to accept arithmetic expressions as direct arguments. It includes comprehensive integration tests validating arithmetic expression support across existing functions and introduces a new TRUNC function test suite. A GitHub Actions workflow interval adjustment is also included. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/sloth.yml (1)
37-37: Increase interval to accommodate expanded test coverage.The interval increase from 10 to 15 seconds aligns with the PR's addition of extensive integration tests across numerous mathematical functions. This provides a reasonable buffer for Sloth execution time.
Consider monitoring Sloth execution times in subsequent CI runs to validate whether this interval remains sufficient as the test suite continues to grow. If Sloth consistently times out or takes excessive time, you may need to increase it further or optimize the test suite.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.github/workflows/sloth.yml(1 hunks)src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.php(1 hunks)src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.php(1 hunks)src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Lgamma.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.php(1 hunks)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.php(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 263
File: src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Numrange.php:19-21
Timestamp: 2025-03-11T12:32:10.726Z
Learning: In the postgresql-for-doctrine repository, PostgreSQL range functions have distinct implementations for different data types. The `Numrange` function works with numeric/decimal values and is tested using the `ContainsDecimals` fixture with properties typed as `float`. In contrast, the `Int4range` function works with 32-bit integers and is tested using the `ContainsIntegers` fixture with properties typed as `int`. While the PHP implementations share a similar structure (extending `BaseFunction`), they are semantically different as they handle different PostgreSQL data types.
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 357
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpMatchTest.php:28-62
Timestamp: 2025-04-22T00:03:37.733Z
Learning: This project focuses on providing Doctrine ORM interfaces to PostgreSQL functions. Tests should validate correct DQL-to-SQL translation rather than PostgreSQL functionality itself. Test cases should focus on parameter passing and SQL generation, not on testing specific PostgreSQL regex pattern behaviors.
📚 Learning: 2025-05-23T11:24:46.898Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 383
File: tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.php:22-24
Timestamp: 2025-05-23T11:24:46.898Z
Learning: The LOG function in PostgreSQL/Doctrine implementation supports both single-argument form (LOG(x) for base 10 logarithm) and two-argument form (LOG(b, x) for logarithm with specified base).
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.php
📚 Learning: 2025-05-23T11:11:57.951Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 383
File: tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php:1-9
Timestamp: 2025-05-23T11:11:57.951Z
Learning: Tests in the `Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase directly, and therefore don't need an explicit import.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.phpsrc/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.phpsrc/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php
📚 Learning: 2025-03-29T03:31:17.114Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 318
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/XmlAggTest.php:1-9
Timestamp: 2025-03-29T03:31:17.114Z
Learning: Tests in the `Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions` namespace extend a custom `TestCase` class from the same namespace (`Tests\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\TestCase`), rather than PHPUnit's TestCase, and therefore don't need an explicit import.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.phpsrc/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.phpsrc/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php
📚 Learning: 2025-09-01T18:48:28.508Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 434
File: tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PostGIS/ST_CrossesTest.php:12-31
Timestamp: 2025-09-01T18:48:28.508Z
Learning: When analyzing unit test files in this codebase, always verify the actual file structure and existing patterns before suggesting changes. The ContainsGeometries fixture exists at ./fixtures/MartinGeorgiev/Doctrine/Entity/ContainsGeometries.php and the PostGIS unit tests use the namespace Tests\Unit\MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS consistently.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php
📚 Learning: 2025-04-22T00:03:37.733Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 357
File: tests/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RegexpMatchTest.php:28-62
Timestamp: 2025-04-22T00:03:37.733Z
Learning: This project focuses on providing Doctrine ORM interfaces to PostgreSQL functions. Tests should validate correct DQL-to-SQL translation rather than PostgreSQL functionality itself. Test cases should focus on parameter passing and SQL generation, not on testing specific PostgreSQL regex pattern behaviors.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php
📚 Learning: 2025-03-11T12:32:10.726Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 263
File: src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Numrange.php:19-21
Timestamp: 2025-03-11T12:32:10.726Z
Learning: In the postgresql-for-doctrine repository, PostgreSQL range functions have distinct implementations for different data types. The `Numrange` function works with numeric/decimal values and is tested using the `ContainsDecimals` fixture with properties typed as `float`. In contrast, the `Int4range` function works with 32-bit integers and is tested using the `ContainsIntegers` fixture with properties typed as `int`. While the PHP implementations share a similar structure (extending `BaseFunction`), they are semantically different as they handle different PostgreSQL data types.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php
📚 Learning: 2025-04-11T11:23:44.192Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 340
File: tests/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTest.php:145-145
Timestamp: 2025-04-11T11:23:44.192Z
Learning: In the PostgreSQL for Doctrine test cases, methods that test database-to-PHP conversions should use `mixed` type for parameter and include non-string test cases in their data providers, following the pattern in classes like InetTest, CidrTest, and MacaddrTest.
Applied to files:
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.phptests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php
📚 Learning: 2025-05-13T00:08:41.638Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 371
File: src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Tsrange.php:25-27
Timestamp: 2025-05-13T00:08:41.638Z
Learning: When implementing node mapping patterns in BaseVariadicFunction subclasses, if all parameters should be of the same type, simply return an array with a single string element (e.g., ['StringPrimary']). This approach uses the same type for all parameters while min/max argument counts can be controlled separately.
Applied to files:
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.php
📚 Learning: 2025-04-18T10:20:44.008Z
Learnt from: martin-georgiev
Repo: martin-georgiev/postgresql-for-doctrine PR: 350
File: src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseVariadicFunction.php:22-26
Timestamp: 2025-04-18T10:20:44.008Z
Learning: The `customizeFunction()` method in `BaseVariadicFunction` should not be marked as final because some child classes like `Arr` need to override it to use different SQL syntax patterns (e.g., square brackets instead of parentheses).
Applied to files:
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Lgamma.php
🧬 Code graph analysis (15)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.php (1)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.php (2)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (5)
Test(19-27)Test(29-37)Test(39-47)Test(49-57)Test(59-67)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.php (2)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (5)
Test(19-27)Test(29-37)Test(39-47)Test(49-57)Test(59-67)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.php (2)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (5)
Test(19-27)Test(29-37)Test(39-47)Test(49-57)Test(59-67)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.php (2)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.php (3)
Test(19-25)Test(27-33)Test(35-41)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.php (4)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Trunc.php (1)
Trunc(15-31)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/NumericTestCase.php (1)
NumericTestCase(9-49)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.php (1)
TruncTest(10-36)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.php (2)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.php (3)
Test(19-25)Test(27-33)Test(35-41)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php (1)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Lgamma.php (1)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php (1)
addNodeMapping(62-65)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.php (3)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (5)
Test(19-27)Test(29-37)Test(39-47)Test(49-57)Test(59-67)tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.php (4)
Test(19-25)Test(27-33)Test(35-41)Test(43-49)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (1)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.php (2)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (5)
Test(19-27)Test(29-37)Test(39-47)Test(49-57)Test(59-67)tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php (1)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.php (1)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php (1)
addNodeMapping(62-65)
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php (1)
tests/Integration/MartinGeorgiev/TestCase.php (1)
executeDqlQuery(284-298)
🔇 Additional comments (16)
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Gamma.php (1)
20-20: LGTM! Arithmetic expression support added.The node mapping change from
ArithmeticPrimarytoSimpleArithmeticExpressionenables the GAMMA function to accept arithmetic expressions as arguments (e.g.,GAMMA(t.integer1 / 2)), which aligns with the PR objective.src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/Lgamma.php (1)
20-20: LGTM! Arithmetic expression support added.The node mapping change mirrors the Gamma function update, enabling LGAMMA to accept arithmetic expressions as arguments.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LnTest.php (1)
35-41: LGTM! Comprehensive test coverage for arithmetic expressions.The new test validates that the LN function correctly handles arithmetic expressions as arguments, following the established test pattern and assertion style.
src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseArithmeticFunction.php (1)
14-17: LGTM! Core change enabling arithmetic expression support.This change updates the node mapping pattern from
ArithmeticPrimarytoSimpleArithmeticExpression, enabling all functions extendingBaseArithmeticFunctionto accept arithmetic expressions as arguments. The change is backward compatible sinceSimpleArithmeticExpressionincludesArithmeticPrimary.tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CeilTest.php (1)
43-49: LGTM! Test validates complex arithmetic expressions.The new test verifies that the CEIL function correctly handles multi-operation arithmetic expressions (multiplication and division), providing good coverage for the feature.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/LogTest.php (1)
35-41: LGTM! Comprehensive test for multi-parameter function.The test validates arithmetic expression support in both parameters of the LOG function (base and value), providing thorough coverage for the two-argument form.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/WidthBucketTest.php (1)
35-41: LGTM! Excellent coverage for multi-parameter function.The test validates arithmetic expression support across all four parameters of WIDTH_BUCKET, providing comprehensive coverage for functions with multiple arithmetic arguments.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/GammaTest.php (1)
58-67: LGTM! Test validates GAMMA arithmetic expression support.The new test confirms that the GAMMA function correctly evaluates arithmetic expressions, complementing the node mapping change in the function implementation.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/SignTest.php (1)
39-47: LGTM! Comprehensive arithmetic expression test.The new test validates SIGN with arithmetic expressions, correctly testing SIGN(n.integer1 - n.integer2) where integer1=10 and integer2=20, resulting in -1. This aligns with the PR objective to support arithmetic expressions in mathematical functions.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RadiansTest.php (1)
35-41: LGTM! Arithmetic expression validation for RADIANS.The test correctly validates RADIANS with an arithmetic expression (n.integer1 * 18 = 180°), expecting π radians. The delta tolerance of 0.0001 is appropriate for floating-point comparison.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/PowerTest.php (1)
69-77: LGTM! Tests arithmetic expressions in both arguments.Excellent test coverage validating POWER with arithmetic expressions in both base and exponent: POWER(n.integer1 + n.integer2, n.integer1 / 5) = POWER(30, 2) = 900. This thoroughly exercises the new SimpleArithmeticExpression support.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/ExpTest.php (1)
35-41: LGTM! Validates EXP with division expression.The test correctly validates EXP with an arithmetic expression (n.integer1 / 10 = 1), expecting Euler's constant. The implementation follows the established pattern from other function tests in this PR.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/CbrtTest.php (1)
59-67: LGTM! Validates CBRT with complex arithmetic expression.The test correctly validates CBRT with a multi-operation arithmetic expression (n.integer1 + n.integer2 - 3 = 27), expecting the cube root of 3.0. This demonstrates proper handling of compound expressions.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/DegreesTest.php (1)
35-41: LGTM! Validates DEGREES with division expression.The test correctly validates DEGREES with an arithmetic expression combining decimal and integer properties (n.decimal1 / n.integer1 = 1.05 radians ≈ 60.16 degrees). The precision delta is appropriately set.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/RoundTest.php (1)
75-103: LGTM! Comprehensive arithmetic expression coverage for ROUND.Excellent test coverage with three complementary scenarios:
- Simple arithmetic expression without precision
- Arithmetic expression with precision parameter
- Parenthesized expression with precision
All calculations are correct and thoroughly validate the SimpleArithmeticExpression support in ROUND function arguments.
tests/Integration/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/TruncTest.php (1)
1-98: LGTM! Comprehensive integration test suite for TRUNC function.This new test class provides excellent coverage for the TRUNC function:
- Basic truncation (positive/negative numbers)
- Precision parameter support (positive/negative precision)
- Column value truncation
- Arithmetic expression support (simple, with precision, parenthesized)
All test calculations are correct, and the implementation follows the established NumericTestCase pattern. The arithmetic expression tests align perfectly with the PR objective of enabling SimpleArithmeticExpression support in mathematical functions.
Summary by CodeRabbit
New Features
Tests