MockService example

$other_service = $container->get('other.service_class_from_parameter');
    $this->assertInstanceOf($other_service_class$other_service);
  }

  /** * Tests that Container::set() works properly. * * @covers ::set */
  public function testSet() {
    $this->assertNull($this->container->get('new_id', ContainerInterface::NULL_ON_INVALID_REFERENCE));
    $mock_service = new MockService();
    $this->container->set('new_id', $mock_service);

    $this->assertSame($mock_service$this->container->get('new_id'), 'A manual set service works as expected.');
  }

  /** * Tests that Container::has() works properly. * * @covers ::has */
  public function testHas() {
    
Home | Imprint | This part of the site doesn't use cookies.