public testCaseSimpleFactoryPlugin_RegistersItself ( ) |
public function testCaseSimpleFactoryPlugin_RegistersItself()
{
$std = new StdClass();
$register = function (SimpleFactoryInterface $factory) use($std) {
$factory->define(function () use($std) {
return $std;
});
};
$factory = $this->createSimpleFactory();
$plugin = $this->createSimpleFactoryPlugin($register);
$plugin->registerPlugin($factory);
$this->assertSame($std, $factory->create());
unset($plugin);
unset($factory);
}