Page MenuHomePhabricator (Chris)

runtimeexception-haserrorlabel_error-001.phpt
No OneTemporary

Authored By
Unknown
Size
527 B
Referenced Files
None
Subscribers
None

runtimeexception-haserrorlabel_error-001.phpt

--TEST--
MongoDB\Driver\Exception\RuntimeException::hasErrorLabel() with non-array values
--FILE--
<?php
$exception = new MongoDB\Driver\Exception\RuntimeException();
$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, 11:09 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152287
Default Alt Text
runtimeexception-haserrorlabel_error-001.phpt (527 B)

Event Timeline