File: manager-debug-001.phpt

package info (click to toggle)
php-mongodb 1.2.3-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 5,908 kB
  • ctags: 5,983
  • sloc: ansic: 57,609; xml: 887; php: 871; sh: 65; pascal: 11; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 1,218 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
MongoDB\Driver\Manager: Writing debug log files
--SKIPIF--
<?php if (defined("HHVM_VERSION_ID")) exit("skip HHVM uses HHVM's logging functionality"); ?>
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE) ?>
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";

$name = tempnam(sys_get_temp_dir(), "PHONGO");
unlink($name);
mkdir($name);
ini_set('mongodb.debug', $name);
$manager = new MongoDB\Driver\Manager(STANDALONE);
$bulk = new MongoDB\Driver\BulkWrite();
$bulk->insert(array('_id' => 1, 'x' => 1));
$result = $manager->executeBulkWrite(NS, $bulk);
ini_set('mongodb.debug', 'off');
foreach(glob($name."/*") as $file);
$content = file($file);
unlink($file);
rmdir($name);

echo $content[0], $content[1];
foreach($content as $line) {
    if (strpos($line, "mongoc_bulk_operation_execute")) {
        echo $line;
    }
}

?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
[%s]     PHONGO: DEBUG   > Connection string: '%s'
[%s]     PHONGO: DEBUG   > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
[%s]     mongoc: TRACE   > ENTRY: mongoc_bulk_operation_execute():%d
[%s]     mongoc: TRACE   >  EXIT: mongoc_bulk_operation_execute():%d
===DONE===