mirror of
https://github.com/predis/predis.git
synced 2026-08-30 20:21:31 +00:00
[tests] Implement test for #257 to guard against regressions.
This commit is contained in:
@@ -178,4 +178,24 @@ class OptionsTest extends PredisTestCase
|
||||
$this->assertSame($custom, $options->custom);
|
||||
$this->assertSame($custom, $options->custom);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testChecksForInvokeMagicMethodDoesNotTriggerAutoloader()
|
||||
{
|
||||
$trigger = $this->getMock('stdClass', array('autoload'));
|
||||
$trigger->expects($this->never())->method('autoload');
|
||||
|
||||
spl_autoload_register($autoload = function ($class) use ($trigger) {
|
||||
$trigger->autoload($class);
|
||||
}, true, false);
|
||||
|
||||
try {
|
||||
$options = new Options(array('prefix' => 'pfx'));
|
||||
$pfx = $options->prefix;
|
||||
} catch (\Exception $_) {
|
||||
spl_autoload_unregister($autoload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user