setError() public method

Set the error/exception message if issues were encountered during the LDAP operation.
public setError ( string $error )
$error string
Ejemplo n.º 1
0
 function it_should_call_the_logger_error_method_when_the_log_contains_an_error($logger)
 {
     $log = new LogOperation((new DeleteOperation('foo'))->setServer('bar'));
     $log->setError('foo');
     $log->setDomain('foo.bar');
     $log->start()->stop();
     $logger->error('(foo.bar on bar) End Delete Operation - Error: foo, Completed in ' . round(($log->getStopTime() - $log->getStartTime()) * 1000) . " ms.")->shouldBeCalled();
     $this->start($log);
 }
 function let(LdapManager $ldap)
 {
     $logger = new LdapProfilerLogger();
     // Add some log data...
     $addOperation = (new AddOperation())->setAttributes(['username' => 'foo', 'unicodePwd' => 'bar']);
     $deleteOperation = new DeleteOperation('foo');
     $addLog = new LogOperation($addOperation);
     $addLog->setDomain('foo.bar');
     $addLog->setError('fail');
     $deleteLog = new LogOperation($deleteOperation);
     $deleteLog->setDomain('example.local');
     /** @var LogOperation $log */
     foreach ([$addLog, $deleteLog] as $log) {
         $logger->start($log->start());
         $logger->end($log->stop());
     }
     $ldap->getDomains()->willReturn(['foo.bar', 'example.local']);
     $this->beConstructedWith($logger, $ldap);
 }