mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-26 01:42:10 +01:00
25 lines
558 B
PHP
25 lines
558 B
PHP
--TEST--
|
|
MongoDB\Driver\Exception\CommandException::hasErrorLabel()
|
|
--FILE--
|
|
<?php
|
|
|
|
$exception = new MongoDB\Driver\Exception\CommandException();
|
|
$labels = ['test', 'foo'];
|
|
|
|
$reflection = new ReflectionClass($exception);
|
|
|
|
$resultDocumentProperty = $reflection->getProperty('errorLabels');
|
|
$resultDocumentProperty->setAccessible(true);
|
|
$resultDocumentProperty->setValue($exception, $labels);
|
|
|
|
var_dump($exception->hasErrorLabel('foo'));
|
|
var_dump($exception->hasErrorLabel('bar'));
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(false)
|
|
===DONE===
|