44 Commits

Author SHA1 Message Date
Jeremy Mikola 366dcbe7d2 PHPC-1411: Prefer integer types for wtimeout when possible
For serialization, 64-bit wtimeout values will always be encoded as strings for portability. Debug output and bsonSerialize() can always use integers on 64-bit platforms and can fall back to strings and Int64 objects on 32-bit platforms, respectively.
2019-12-19 06:51:06 +01:00
Andreas Braun a54fbcd8c0 PHPC-1411: Emit warning when truncating 64-bit value 2019-12-19 06:50:41 +01:00
Andreas Braun cdff70faf6 PHPC-1411: Accept 64-bit integers for wTimeoutMS 2019-12-19 06:50:41 +01:00
Andreas Braun 7a98fb6f52 Fix wrong grammar in comment 2019-10-18 13:45:13 -04:00
Andreas Braun 0437e98453 PHPC-1281: Add Serializable support for MongoDB\Driver\WriteConcern 2019-10-18 13:23:48 -04:00
Derick Rethans 9cbb01a860 PHPC-1206: Add __set_state() support for ReadPreference 2018-10-19 16:26:17 -04:00
Derick Rethans b03d1714c4 PHPC-1206: Add __set_state() support for WriteConcern 2018-10-19 16:26:17 -04:00
Derick Rethans d92d94224a PHPC-850: var_export() support for WriteConcern 2018-06-07 17:08:22 +01:00
Derick Rethans 98e583b738 PHPC-1175: Fixed test cases due to changes in variable type names in PHP 7.3 2018-05-17 16:18:27 +02:00
Jeremy Mikola 0b200dda09 PHPC-1133: Remove unused includes in SKIPIF and FILE sections 2018-02-27 09:48:25 -05:00
Jeremy Mikola 05c83bdef2 PHPC-1132: Remove HHVM checks in test suite 2018-02-27 09:48:25 -05:00
Jeremy Mikola 03af904b5d PHPC-1071: Report class name for unexpected object values
This only updates exceptions where object types are entirely unexpected. For instance, options that expect a BSON document (i.e. array or object) need not use this macro, as any object would be accepted.
2017-12-15 11:23:44 -05:00
Derick Rethans f609ac7d35 PHPC-1037: Upgrade bundled libmongoc and libbson to 1.9 2017-11-21 14:47:12 +00:00
Jeremy Mikola 7158ed16e8 PHPC-976: Add more test cases for default read and write concerns 2017-08-17 12:11:41 -04:00
Jeremy Mikola f581777126 PHPC-976: RC and WC isDefault() tests don't need a server 2017-08-17 12:11:41 -04:00
Jeremy Mikola 31aa04b746 PHPC-976: isDefault() method for read and write concerns 2017-07-11 16:56:19 -04:00
Jeremy Mikola a267e05eb8 Comprehensive tests for RC, RP, and WC debug output and BSON serialization 2016-09-26 10:53:21 -04:00
Jeremy Mikola 97a26a18e7 Remove unnecessary SKIPIFs from extends tests 2016-09-21 16:32:39 -04:00
Derick Rethans 8f9e6c8c53 PHPC-498: ReadPreference, ReadConcern, and WriteConcern should serialize to BSON 2016-09-19 20:33:14 +01:00
Jeremy Mikola 4d8e3e304a PHPC-595: Throw exception if wtimeout > INT32_MAX
This also defines a compatility constant for printing phongo_long, which may vary by PHP version and architecture.
2016-02-29 12:43:34 -05:00
Jeremy Mikola 2fa57d7d05 Regression test for extending final classes 2016-02-09 15:25:14 -05:00
Derick Rethans 9aad2931d3 Fixed test case, where PHP 5 and PHP 7 call the type differently 2015-12-18 16:15:40 +00:00
Jeremy Mikola dcbf5ae6ba PHPC-428: Remove support for WriteConcern fsync option 2015-09-23 11:47:53 -04:00
Jeremy Mikola 44a85b5438 PHPC-427: Do not set WC journal/fsync to false for NULL args 2015-09-22 14:10:50 -04:00
Jeremy Mikola 380aee31c9 Additional tests for WriteConcern debug handler 2015-09-22 14:07:23 -04:00
Jeremy Mikola a6932d59e0 PHPC-423: WriteConcern should report default "w" option as null 2015-09-22 14:07:23 -04:00
Jeremy Mikola 3f8b851556 PHPC-426: WC ctor should throw for invalid $w and $wtimeout args 2015-09-22 14:06:37 -04:00
Jeremy Mikola 7757f1118a PHPC-425: WC ctor should accept int/string $w args w/o casting 2015-09-22 14:06:37 -04:00
Jeremy Mikola 6b5e7cacb2 WriteConcern ctor error test doesn't need EXPECTF 2015-09-22 14:06:37 -04:00
Jeremy Mikola 33e91fa908 Use throws() helper function in WriteConcern ctor error test 2015-09-22 14:06:37 -04:00
Jeremy Mikola 4e01486cd6 PHPC-418: Getters for WriteConcern properties 2015-09-16 17:37:14 -04:00
Jeremy Mikola 106ee84693 Rename WriteConcern tests 2015-09-16 17:37:14 -04:00
Derick Rethans b31ad7c271 PHPC-129: Split out WriteConcern constructor error test
The error test should be skipped for HHVM, since it currently has inconsistent error handling.
2015-08-05 21:11:16 -04:00
Jeremy Mikola 998c85bfba PHPC-179: Show unset journal/fsync as null in WriteConcern debug handler 2015-05-04 14:24:37 -04:00
Hannes Magnusson 227e7842cb Use absolute paths in skipifs too 2015-03-25 14:08:39 -07:00
Hannes Magnusson 1cce49d21c Use absolute paths on in tests so they can run easier on windows 2015-03-25 13:32:09 -07:00
Jeremy Mikola 70715516b5 PHPC-177: Include all fields in WriteConcern debug output
This mainly removes logic where no fields were included in the debug output if "w" was equal to MONGOC_WRITE_CONCERN_W_DEFAULT.

Although the "wmajority" boolean exists, we can still report the actual "w" value, which will be sent to the server.
2015-03-13 02:26:51 -04:00
Jeremy Mikola a56939385e Remove unnecessary Manager and apply EXPECTF patterns 2015-03-12 19:48:01 -04:00
Hannes Magnusson 4acca269c2 This is a Manager, not MongoClient 2015-02-19 13:59:50 -08:00
Hannes Magnusson a9823e706f Ignore me. Trim trailing space
This has been annoying me for a long time, especially the '<?php '
2015-02-19 13:57:58 -08:00
Hannes Magnusson 4b8ef30fd1 PHPC-138: var_dump()ing WriteConcern 2015-01-27 11:56:15 -08:00
Hannes Magnusson bb5f45c313 PHPC-118: Use MongoDB\Driver namespace for phongo 2014-12-30 14:58:33 -08:00
Jeremy Mikola 773bc909cb PHP-1173: Use string "majority" for WriteConcern::MAJORITY
The purpose is two-fold: abstract libmongo'c constant (defined as -3) from our users and ensure the string "majority" is sets the struct's "w" field properly even if our constant is not used.
2014-10-03 16:02:53 -04:00
Hannes Magnusson 19cfa46ee1 new tests 2014-07-21 22:07:48 +00:00