Skip to content

Commit a2ec28f

Browse files
author
anahan
committed
Tests refactoring
1 parent 60cfdce commit a2ec28f

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"autoload-dev": {
1616
"psr-4": {
1717
"CodeTool\\Jaeger\\Tests\\MongoDb\\": "test/"
18-
}
18+
},
19+
"files": [
20+
"test/functions.php"
21+
]
1922
},
2023
"require-dev": {
2124
"phpunit/phpunit": "^6.5.5"

test/CommandToStringConvertorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public function dataProvider()
2626
'db.runCommand({query: {player_id: {$in: [\'...\']}}})'
2727
],
2828
[
29-
new OVal(
29+
ov(
3030
'query',
31-
new OVal(
31+
ov(
3232
'c',
33-
new OVal('$gte', new UTCDateTime(1000000), '$lte', '$now')
33+
ov('$gte', new UTCDateTime(1000000), '$lte', '$now')
3434
)
3535
),
3636
'db.runCommand({query: {c: {$gte: new UTCDateTime(?), $lte: "$now"}}})'

test/functions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace CodeTool\Jaeger\Tests\MongoDb;
4+
5+
function ov(...$kv)
6+
{
7+
return new OVal(...$kv);
8+
}

0 commit comments

Comments
 (0)