/** * {@inheritdoc} */ public function has($id) { if (isset($this->mockedServices['mock::' . $this->normalize($this->normalize($id))])) { return true; } return parent::has($id); }
/** * @expectedException \Viserio\Contracts\Container\Exceptions\ContainerException * @expectedExceptionMessage The name parameter must be of type string, [stdClass] given. */ public function testHasToThrowExceptionOnNoStringType() { $container = new Container(); $this->assertFalse($container->has(new StdClass())); }