Skip to content

Commit 331d387

Browse files
committed
Revert "PHPC-977: Update tests for expected JSON output from libbson"
This reverts commit 2761072.
1 parent c5e859d commit 331d387

14 files changed

+53
-53
lines changed

tests/bson/bson-binary-001.phpt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,36 @@ bool(true)
5252
bool(true)
5353
bool(true)
5454
bool(true)
55-
Test#0 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "00" } } }
56-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "00" } } }"
57-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "00" } } }"
55+
Test#0 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "00" } }
56+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "00" } }"
57+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "00" } }"
5858
bool(true)
59-
Test#1 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "01" } } }
60-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "01" } } }"
61-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "01" } } }"
59+
Test#1 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "01" } }
60+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "01" } }"
61+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "01" } }"
6262
bool(true)
63-
Test#2 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "02" } } }
64-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "02" } } }"
65-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "02" } } }"
63+
Test#2 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "02" } }
64+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "02" } }"
65+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "02" } }"
6666
bool(true)
67-
Test#3 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "03" } } }
68-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "03" } } }"
69-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "03" } } }"
67+
Test#3 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "03" } }
68+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "03" } }"
69+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "03" } }"
7070
bool(true)
71-
Test#4 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "04" } } }
72-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "04" } } }"
73-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "04" } } }"
71+
Test#4 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "04" } }
72+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "04" } }"
73+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "04" } }"
7474
bool(true)
75-
Test#5 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "05" } } }
76-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "05" } } }"
77-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "05" } } }"
75+
Test#5 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "05" } }
76+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "05" } }"
77+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "05" } }"
7878
bool(true)
79-
Test#6 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "80" } } }
80-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "80" } } }"
81-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "80" } } }"
79+
Test#6 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "80" } }
80+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "80" } }"
81+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "80" } }"
8282
bool(true)
83-
Test#7 { "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "85" } } }
84-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "85" } } }"
85-
string(89) "{ "binary" : { "$binary" : { "base64": "cmFuZG9tQmluYXJ5RGF0YQ==", "subType" : "85" } } }"
83+
Test#7 { "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "85" } }
84+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "85" } }"
85+
string(73) "{ "binary" : { "$binary" : "cmFuZG9tQmluYXJ5RGF0YQ==", "$type" : "85" } }"
8686
bool(true)
8787
===DONE===

tests/bson/bson-binary-jsonserialize-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var_dump(toPHP(fromJSON($json)));
1616
===DONE===
1717
<?php exit(0); ?>
1818
--EXPECTF--
19-
{ "foo" : { "$binary" : { "base64": "Z2FyZ2xlYmxhc3Rlcg==", "subType" : "18" } } }
19+
{ "foo" : { "$binary" : "Z2FyZ2xlYmxhc3Rlcg==", "$type" : "18" } }
2020
{"foo":{"$binary":"Z2FyZ2xlYmxhc3Rlcg==","$type":"18"}}
2121
object(stdClass)#%d (%d) {
2222
["foo"]=>

tests/bson/bson-encode-003.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ foreach($tests as $n => $test) {
4646
===DONE===
4747
<?php exit(0); ?>
4848
--EXPECTF--
49-
Test#0 { "stuff" : { "__pclass" : { "$binary" : { "base64": "TXlDbGFzcw==", "subType" : "80" } }, "random" : "class", "0" : "data" } }
49+
Test#0 { "stuff" : { "__pclass" : { "$binary" : "TXlDbGFzcw==", "$type" : "80" }, "random" : "class", "0" : "data" } }
5050
0 : 45 00 00 00 03 73 74 75 66 66 00 39 00 00 00 05 [E....stuff.9....]
5151
10 : 5f 5f 70 63 6c 61 73 73 00 07 00 00 00 80 4d 79 [__pclass......My]
5252
20 : 43 6c 61 73 73 02 72 61 6e 64 6f 6d 00 06 00 00 [Class.random....]
@@ -71,7 +71,7 @@ object(stdClass)#%d (1) {
7171
}
7272
}
7373
}
74-
Test#1 { "stuff" : { "__pclass" : { "$binary" : { "base64": "TXlDbGFzczI=", "subType" : "80" } }, "0" : 1, "1" : 2, "2" : 3 } }
74+
Test#1 { "stuff" : { "__pclass" : { "$binary" : "TXlDbGFzczI=", "$type" : "80" }, "0" : 1, "1" : 2, "2" : 3 } }
7575
0 : 3d 00 00 00 03 73 74 75 66 66 00 31 00 00 00 05 [=....stuff.1....]
7676
10 : 5f 5f 70 63 6c 61 73 73 00 08 00 00 00 80 4d 79 [__pclass......My]
7777
20 : 43 6c 61 73 73 32 10 30 00 01 00 00 00 10 31 00 [Class2.0......1.]
@@ -97,7 +97,7 @@ object(stdClass)#%d (1) {
9797
}
9898
}
9999
}
100-
Test#2 { "stuff" : [ { "__pclass" : { "$binary" : { "base64": "TXlDbGFzcw==", "subType" : "80" } }, "random" : "class", "0" : "data" }, { "__pclass" : { "$binary" : { "base64": "TXlDbGFzczI=", "subType" : "80" } }, "0" : 1, "1" : 2, "2" : 3 } ] }
100+
Test#2 { "stuff" : [ { "__pclass" : { "$binary" : "TXlDbGFzcw==", "$type" : "80" }, "random" : "class", "0" : "data" }, { "__pclass" : { "$binary" : "TXlDbGFzczI=", "$type" : "80" }, "0" : 1, "1" : 2, "2" : 3 } ] }
101101
0 : 81 00 00 00 04 73 74 75 66 66 00 75 00 00 00 03 [.....stuff.u....]
102102
10 : 30 00 39 00 00 00 05 5f 5f 70 63 6c 61 73 73 00 [0.9....__pclass.]
103103
20 : 07 00 00 00 80 4d 79 43 6c 61 73 73 02 72 61 6e [.....MyClass.ran]

tests/bson/bson-encode-004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object(Person)#%d (5) {
7373
["secret":protected]=>
7474
string(24) "Hannes confidential info"
7575
}
76-
Test { "0" : { "__pclass" : { "$binary" : { "base64": "UGVyc29u", "subType" : "80" } }, "name" : "Hannes", "age" : 42, "addresses" : [ { "__pclass" : { "$binary" : { "base64": "QWRkcmVzcw==", "subType" : "80" } }, "zip" : 94086, "country" : "USA" }, { "__pclass" : { "$binary" : { "base64": "QWRkcmVzcw==", "subType" : "80" } }, "zip" : 200, "country" : "Iceland" } ], "friends" : [ { "__pclass" : { "$binary" : { "base64": "UGVyc29u", "subType" : "80" } }, "name" : "Jeremy", "age" : 21, "addresses" : [ ], "friends" : [ ] } ] } }
76+
Test { "0" : { "__pclass" : { "$binary" : "UGVyc29u", "$type" : "80" }, "name" : "Hannes", "age" : 42, "addresses" : [ { "__pclass" : { "$binary" : "QWRkcmVzcw==", "$type" : "80" }, "zip" : 94086, "country" : "USA" }, { "__pclass" : { "$binary" : "QWRkcmVzcw==", "$type" : "80" }, "zip" : 200, "country" : "Iceland" } ], "friends" : [ { "__pclass" : { "$binary" : "UGVyc29u", "$type" : "80" }, "name" : "Jeremy", "age" : 21, "addresses" : [ ], "friends" : [ ] } ] } }
7777
0 : 23 01 00 00 03 30 00 1b 01 00 00 05 5f 5f 70 63 [#....0......__pc]
7878
10 : 6c 61 73 73 00 06 00 00 00 80 50 65 72 73 6f 6e [lass......Person]
7979
20 : 02 6e 61 6d 65 00 07 00 00 00 48 61 6e 6e 65 73 [.name.....Hannes]

tests/bson/bson-fromPHP-003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ foreach ($tests as $document) {
3030
===DONE===
3131
<?php exit(0); ?>
3232
--EXPECT--
33-
Test { "0" : { "$date" : "2014-11-20T01:03:31.987Z" } }
33+
Test { "0" : { "$date" : 1416445411987 } }
3434
0 : 10 00 00 00 09 30 00 93 c2 b9 ca 49 01 00 00 00 [.....0.....I....]
35-
Test { "x" : { "$date" : "2014-11-20T01:03:31.987Z" } }
35+
Test { "x" : { "$date" : 1416445411987 } }
3636
0 : 10 00 00 00 09 78 00 93 c2 b9 ca 49 01 00 00 00 [.....x.....I....]
3737
Test { "0" : { "baz" : 3 } }
3838
0 : 16 00 00 00 03 30 00 0e 00 00 00 10 62 61 7a 00 [.....0......baz.]

tests/bson/bson-regex-001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ foreach($tests as $n => $test) {
2929
Pattern: regexp
3030
Flags: i
3131
String representation: /regexp/i
32-
Test#0 { "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "i" } } }
33-
string(82) "{ "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "i" } } }"
34-
string(82) "{ "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "i" } } }"
32+
Test#0 { "regex" : { "$regex" : "regexp", "$options" : "i" } }
33+
string(55) "{ "regex" : { "$regex" : "regexp", "$options" : "i" } }"
34+
string(55) "{ "regex" : { "$regex" : "regexp", "$options" : "i" } }"
3535
bool(true)
3636
===DONE===

tests/bson/bson-regex-003.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ foreach($tests as $n => $test) {
2929
Pattern: regexp
3030
Flags:
3131
String representation: /regexp/
32-
Test#0 { "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "" } } }
33-
string(81) "{ "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "" } } }"
34-
string(81) "{ "regex" : { "$regularExpression" : { "pattern" : "regexp", "options" : "" } } }"
32+
Test#0 { "regex" : { "$regex" : "regexp", "$options" : "" } }
33+
string(54) "{ "regex" : { "$regex" : "regexp", "$options" : "" } }"
34+
string(54) "{ "regex" : { "$regex" : "regexp", "$options" : "" } }"
3535
bool(true)
3636
===DONE===

tests/bson/bson-regex-jsonserialize-003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var_dump(toPHP(fromJSON($json)));
1616
===DONE===
1717
<?php exit(0); ?>
1818
--EXPECTF--
19-
{ "foo" : { "$regularExpression" : { "pattern" : "pattern", "options" : "" } } }
19+
{ "foo" : { "$regex" : "pattern", "$options" : "" } }
2020
{"foo":{"$regex":"pattern","$options":""}}
2121
object(stdClass)#%d (%d) {
2222
["foo"]=>

tests/bson/bson-regex-jsonserialize-004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var_dump(toPHP(fromJSON($json)));
1616
===DONE===
1717
<?php exit(0); ?>
1818
--EXPECTF--
19-
{ "foo" : { "$regularExpression" : { "pattern" : "pattern", "options" : "i" } } }
19+
{ "foo" : { "$regex" : "pattern", "$options" : "i" } }
2020
{"foo":{"$regex":"pattern","$options":"i"}}
2121
object(stdClass)#%d (%d) {
2222
["foo"]=>

tests/bson/bson-toExtendedJSON-002.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ foreach ($tests as $value) {
2626
<?php exit(0); ?>
2727
--EXPECT--
2828
{ "_id" : { "$oid" : "56315a7c6118fd1b920270b1" } }
29-
{ "binary" : { "$binary" : { "base64": "Zm9v", "subType" : "00" } } }
29+
{ "binary" : { "$binary" : "Zm9v", "$type" : "00" } }
3030
{ "date" : { "$date" : { "$numberLong" : "1445990400000" } } }
31-
{ "timestamp" : { "$timestamp" : { "t" : 1446084619, "i" : 0 } } }
32-
{ "regex" : { "$regularExpression" : { "pattern" : "pattern", "options" : "i" } } }
31+
{ "timestamp" : { "$timestamp" : "6210886145853620224" } }
32+
{ "regex" : { "$regex" : "pattern", "$options" : "i" } }
3333
{ "minkey" : { "$minKey" : 1 } }
3434
{ "maxkey" : { "$maxKey" : 1 } }
3535
{ "long" : { "$numberInt" : "1234" } }

0 commit comments

Comments
 (0)