You are here

public function ContainerTest::testSet in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/symfony/dependency-injection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testSet()
  2. 8.0 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php \Drupal\Tests\Core\DependencyInjection\ContainerTest::testSet()
  3. 8.0 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testSet()
Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testSet()

@covers Symfony\Component\DependencyInjection\Container::set

File

vendor/symfony/dependency-injection/Tests/ContainerTest.php, line 155

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSet() {
  $sc = new Container();
  $sc
    ->set('foo', $foo = new \stdClass());
  $this
    ->assertEquals($foo, $sc
    ->get('foo'), '->set() sets a service');
}