<commit_before>--TEST--
MongoDB\Driver\WriteConcern construction
--SKIPIF--
<?php require "tests/utils/basic-skipif.inc"?>
--FILE--
<?php
require_once "tests/utils/basic.inc";

$manager = new MongoDB\Driver\Manager(MONGODB_URI);


$w = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY);
$w2 = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 1000);

$w3 = new MongoDB\Driver\WriteConcern(2);
$w4 = new MongoDB\Driver\WriteConcern(2, 2000);

$w5 = new MongoDB\Driver\WriteConcern("tagname");
$w6 = new MongoDB\Driver\WriteConcern("string", 3000);

$w7 = new MongoDB\Driver\WriteConcern("string", 3000, false, false);
$w8 = new MongoDB\Driver\WriteConcern("string", 3000, true, true);

$w9 = new MongoDB\Driver\WriteConcern("string", 3000, true, false);
$w10= new MongoDB\Driver\WriteConcern("string", 3000, false, true);


var_dump($w, $w2, $w3, $w4, $w5, $w6, $w7, $w8, $w9, $w10);

try {
    new MongoDB\Driver\WriteConcern("string", 3000, false, true, 1);
} catch(InvalidArgumentException $e) {
    echo $e->getMessage(), "\n";
}

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["wmajority"]=>
  bool(true)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["wmajority"]=>
  bool(true)
  ["wtimeout"]=>
  int(1000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  int(2)
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  int(2)
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(2000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(7) "tagname"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#10 (5) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(true)
  ["journal"]=>
  bool(true)
}
object(MongoDB\Driver\WriteConcern)#11 (5) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(true)
}
object(MongoDB\Driver\WriteConcern)#12 (5) {
  ["w"]=>
  string(6) "string"<commit_msg>Remove unnecessary Manager and apply EXPECTF patterns<commit_after>--TEST--
MongoDB\Driver\WriteConcern construction
--SKIPIF--
<?php require "tests/utils/basic-skipif.inc"?>
--FILE--
<?php
require_once "tests/utils/basic.inc";

$w = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY);
$w2 = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 1000);

$w3 = new MongoDB\Driver\WriteConcern(2);
$w4 = new MongoDB\Driver\WriteConcern(2, 2000);

$w5 = new MongoDB\Driver\WriteConcern("tagname");
$w6 = new MongoDB\Driver\WriteConcern("string", 3000);

$w7 = new MongoDB\Driver\WriteConcern("string", 3000, false, false);
$w8 = new MongoDB\Driver\WriteConcern("string", 3000, true, true);

$w9 = new MongoDB\Driver\WriteConcern("string", 3000, true, false);
$w10= new MongoDB\Driver\WriteConcern("string", 3000, false, true);

var_dump($w, $w2, $w3, $w4, $w5, $w6, $w7, $w8, $w9, $w10);

try {
    new MongoDB\Driver\WriteConcern("string", 3000, false, true, 1);
} catch(InvalidArgumentException $e) {
    echo $e->getMessage(), "\n";
}

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["wmajority"]=>
  bool(true)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["wmajority"]=>
  bool(true)
  ["wtimeout"]=>
  int(1000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  int(2)
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  int(2)
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(2000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(7) "tagname"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(0)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(false)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(true)
  ["journal"]=>
  bool(true)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
  ["wmajority"]=>
  bool(false)
  ["wtimeout"]=>
  int(3000)
  ["fsync"]=>
  bool(false)
  ["journal"]=>
  bool(true)
}
object(MongoDB\Driver\WriteConcern)#%d (%d) {
  ["w"]=>
  string(6) "string"
{'fraction_non_alphanumeric': 0.2368147120055517, 'fraction_numerical': 0.03313671061762665, 'mean_word_length': 4.74203187250996, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2480651', 'n_tokens_mistral': 2631, 'n_tokens_neox': 2452, 'n_words': 400}