Page MenuHomePhabricator (Chris)

bulkwriteexception-haserrorlabel_error-001.phpt
No OneTemporary

Authored By
Unknown
Size
531 B
Referenced Files
None
Subscribers
None

bulkwriteexception-haserrorlabel_error-001.phpt

--TEST--
MongoDB\Driver\Exception\BulkWriteException::hasErrorLabel() with non-array values
--FILE--
<?php
$exception = new MongoDB\Driver\Exception\BulkWriteException();
$labels = 'shouldBeAnArray';
$reflection = new ReflectionClass($exception);
$resultDocumentProperty = $reflection->getProperty('errorLabels');
$resultDocumentProperty->setAccessible(true);
$resultDocumentProperty->setValue($exception, $labels);
var_dump($exception->hasErrorLabel('bar'));
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(false)
===DONE===

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 4:29 PM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152473
Default Alt Text
bulkwriteexception-haserrorlabel_error-001.phpt (531 B)

Event Timeline