Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

PHPLIB-1374 Add tests on all stages #56

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generator/config/accumulator/covariancePop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
covariancePopForState:
$covariancePop:
-
# Example uses the short form, the builder always generates the verbose form
# $year: '$orderDate'
$year:
date: '$orderDate'
Expand Down
1 change: 1 addition & 0 deletions generator/config/accumulator/covarianceSamp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
covarianceSampForState:
$covarianceSamp:
-
# Example uses the short form, the builder always generates the verbose form
# $year: '$orderDate'
$year:
date: '$orderDate'
Expand Down
2 changes: 2 additions & 0 deletions generator/config/accumulator/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ tests:
$group:
_id:
day:
# Example uses the short form, the builder always generates the verbose form
# $dayOfYear: '$date'
$dayOfYear:
date: '$date'
year:
# Example uses the short form, the builder always generates the verbose form
# $year: '$date'
$year:
date: '$date'
Expand Down
2 changes: 2 additions & 0 deletions generator/config/accumulator/sum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ tests:
$group:
_id:
day:
# Example uses the short form, the builder always generates the verbose form
# $dayOfYear: '$date'
$dayOfYear:
date: '$date'
year:
# Example uses the short form, the builder always generates the verbose form
# $year: '$date'
$year:
date: '$date'
Expand Down
2 changes: 1 addition & 1 deletion generator/config/expression/arrayToObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tests:
$project:
item: 1
dimensions:
# The example renders a single value, but the builder generates an array for consistency
# Example uses the short form, the builder always generates the verbose form
# $arrayToObject: '$dimensions'
$arrayToObject:
- '$dimensions'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/avg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tests:
-
$project:
quizAvg:
# Example uses the short form, the builder always generates the verbose form
# $avg: '$quizzes'
$avg:
- '$quizzes'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/dateAdd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ tests:
unit: 'day'
amount: 3
-
# Example uses the short form, the builder always generates the verbose form
# $merge: 'shipping'
$merge:
into: 'shipping'
Expand Down
1 change: 0 additions & 1 deletion generator/config/expression/dateFromString.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ tests:
$dateFromString:
dateString: '$date'
timezone: '$timezone'
# onNull: new Date(0)
onNull: !bson_utcdatetime 0

2 changes: 2 additions & 0 deletions generator/config/expression/dateSubtract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ tests:
$expr:
$eq:
-
# Example uses the short form, the builder always generates the verbose form
# $month: '$logout'
$month:
date: '$logout'
Expand All @@ -55,6 +56,7 @@ tests:
unit: 'hour'
amount: 3
-
# Example uses the short form, the builder always generates the verbose form
# $merge: 'connectionTime'
$merge:
into: 'connectionTime'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/dayOfMonth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
day:
# Example uses the short form, the builder always generates the verbose form
# $dayOfMonth: '$date'
$dayOfMonth:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/dayOfWeek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
dayOfWeek:
# Example uses the short form, the builder always generates the verbose form
# $dayOfWeek: '$date'
$dayOfWeek:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/dayOfYear.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
dayOfYear:
# Example uses the short form, the builder always generates the verbose form
# $dayOfYear: '$date'
$dayOfYear:
date: '$date'
4 changes: 2 additions & 2 deletions generator/config/expression/getField.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests:
$expr:
$gt:
-
# the builder uses the verbose form with parameter names
# Example uses the short form, the builder always generates the verbose form
# $getField: 'price.usd'
$getField:
field: 'price.usd'
Expand All @@ -48,7 +48,7 @@ tests:
$gt:
-
$getField:
# the builder uses the verbose form with parameter names
# Example uses the short form, the builder always generates the verbose form
# $literal: '$price'
field:
$literal: '$price'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/hour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
hour:
# Example uses the short form, the builder always generates the verbose form
# $hour: '$date'
$hour:
date: '$date'
3 changes: 1 addition & 2 deletions generator/config/expression/isArray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ tests:
$cond:
if:
$and:
# The example in the docs uses the short syntax for $isArray,
# but the aggregation builder always uses the more verbose syntax.
# Example uses the short form, the builder always generates the verbose form
-
$isArray:
- '$instock'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/isoDayOfWeek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tests:
_id: 0
name: '$name'
dayOfWeek:
# Example uses the short form, the builder always generates the verbose form
# $isoDayOfWeek: '$birthday'
$isoDayOfWeek:
date: '$birthday'
1 change: 1 addition & 0 deletions generator/config/expression/isoWeek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tests:
_id: 0
city: '$city'
weekNumber:
# Example uses the short form, the builder always generates the verbose form
# $isoWeek: '$date'
$isoWeek:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/isoWeekYear.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
yearNumber:
# Example uses the short form, the builder always generates the verbose form
# $isoWeekYear: '$date'
$isoWeekYear:
date: '$date'
2 changes: 1 addition & 1 deletion generator/config/expression/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tests:
input: '$distances'
as: 'decimalValue'
in:
# The example renders a single value, but the builder generates an array for consistency
# Example uses the short form, the builder always generates the verbose form
# $trunc: '$$decimalValue'
$trunc:
- '$$decimalValue'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/max.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tests:
-
$project:
quizMax:
# Example uses the short form, the builder always generates the verbose form
# $max: '$quizzes'
$max:
- '$quizzes'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/millisecond.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
milliseconds:
# Example uses the short form, the builder always generates the verbose form
# $millisecond: '$date'
$millisecond:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/min.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tests:
-
$project:
quizMin:
# Example uses the short form, the builder always generates the verbose form
# $min: '$quizzes'
$min:
- '$quizzes'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/minute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
minutes:
# Example uses the short form, the builder always generates the verbose form
# $minute: '$date'
$minute:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/month.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
month:
# Example uses the short form, the builder always generates the verbose form
# $month: '$date'
$month:
date: '$date'
3 changes: 1 addition & 2 deletions generator/config/expression/objectToArray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ tests:
warehouses:
$objectToArray: '$instock'
-
# The example in the docs uses the short syntax for $unwind,
# but the aggregation builder always uses the more verbose syntax.
# Example uses the short form, the builder always generates the verbose form
# $unwind: '$warehouses'
$unwind:
path: '$warehouses'
Expand Down
2 changes: 1 addition & 1 deletion generator/config/expression/pow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tests:
variance:
$pow:
-
# The builder renders $stdDevPop with the array form, even with a single value
# Example uses the short form, the builder always generates the verbose form
# $stdDevPop: '$scores.score'
$stdDevPop: ['$scores.score']
- 2
1 change: 1 addition & 0 deletions generator/config/expression/rand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tests:
amount:
$floor: '$amount'
-
# Example uses the short form, the builder always generates the verbose form
# $merge: 'donors'
$merge:
into: 'donors'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/second.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
seconds:
# Example uses the short form, the builder always generates the verbose form
# $second: '$date'
$second:
date: '$date'
2 changes: 2 additions & 0 deletions generator/config/expression/setField.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ tests:
input: '$$ROOT'
value: '$price'
-
# Example uses the short form, the builder always generates the verbose form
# $unset: 'price'
$unset:
- 'price'
Expand All @@ -54,6 +55,7 @@ tests:
input: '$$ROOT'
value: '$price'
-
# Example uses the short form, the builder always generates the verbose form
# $unset: 'price'
$unset:
- 'price'
Expand Down
3 changes: 1 addition & 2 deletions generator/config/expression/size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ tests:
numberOfColors:
$cond:
if:
# The example in the docs uses the short syntax for $isArray,
# but the aggregation builder always uses the more verbose syntax.
# Example uses the short form, the builder always generates the verbose form
# $isArray: '$colors'
$isArray:
- '$colors'
Expand Down
3 changes: 1 addition & 2 deletions generator/config/expression/sortArray.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ tests:
a:
sale: true
price: 19
# Decimal128( "10.23" )
- 10.23
- !bson_decimal128 '10.23'
-
a: 'On sale'
sortBy: 1
1 change: 1 addition & 0 deletions generator/config/expression/stdDevPop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ tests:
-
$project:
stdDev:
# Example uses the short form, the builder always generates the verbose form
# $stdDevPop: '$scores.score'
$stdDevPop: ['$scores.score']
2 changes: 2 additions & 0 deletions generator/config/expression/sum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ arguments:
name: expression
type:
- resolvesToNumber
- resolvesToArray
variadic: array
tests:
-
Expand All @@ -21,6 +22,7 @@ tests:
-
$project:
quizTotal:
# Example uses the short form, the builder always generates the verbose form
# $sum: '$quizzes'
$sum:
- '$quizzes'
Expand Down
1 change: 1 addition & 0 deletions generator/config/expression/unsetField.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ tests:
$unsetField:
field: 'euro'
input:
# Example uses the short form, the builder always generates the verbose form
# $getField: 'price'
$getField:
field: 'price'
1 change: 1 addition & 0 deletions generator/config/expression/week.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
week:
# Example uses the short form, the builder always generates the verbose form
# $week: '$date'
$week:
date: '$date'
1 change: 1 addition & 0 deletions generator/config/expression/year.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests:
-
$project:
year:
# Example uses the short form, the builder always generates the verbose form
# $year: '$date'
$year:
date: '$date'
Loading