Commit 9cdfb35f by Qiang Xue

Fixes #3312.

parent ad31cf6f
......@@ -22,10 +22,11 @@ class InstanceTest extends TestCase
{
$container = new Container;
$className = Component::className();
$instance = Instance::of($className, $container);
$instance = Instance::of($className);
$this->assertTrue($instance instanceof Instance);
$this->assertTrue($instance->get() instanceof Component);
$this->assertTrue(Instance::ensure($instance, $className) instanceof Component);
$this->assertTrue($instance->get() !== Instance::ensure($instance, $className));
$this->assertTrue($instance->get($container) instanceof Component);
$this->assertTrue(Instance::ensure($instance, $className, $container) instanceof Component);
$this->assertTrue($instance->get($container) !== Instance::ensure($instance, $className, $container));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment