Page MenuHomePhabricator (Chris)

runtimeexception-haserrorlabel-001.phpt
No OneTemporary

Authored By
Unknown
Size
512 B
Referenced Files
None
Subscribers
None

runtimeexception-haserrorlabel-001.phpt

--TEST--
MongoDB\Driver\Exception\RuntimeException::hasErrorLabel()
--FILE--
<?php
$exception = new MongoDB\Driver\Exception\RuntimeException();
$labels = ['test', 'foo'];
$reflection = new ReflectionClass($exception);
$resultDocumentProperty = $reflection->getProperty('errorLabels');
$resultDocumentProperty->setValue($exception, $labels);
var_dump($exception->hasErrorLabel('foo'));
var_dump($exception->hasErrorLabel('bar'));
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(true)
bool(false)
===DONE===

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 8:10 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
143877
Default Alt Text
runtimeexception-haserrorlabel-001.phpt (512 B)

Event Timeline