
| Current Path : /var/www/html_old/12park.001/web/core/tests/Drupal/Tests/Core/DependencyInjection/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html_old/12park.001/web/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php |
<?php
namespace Drupal\Tests\Core\DependencyInjection;
use Drupal\Core\DependencyInjection\Container;
use Drupal\Tests\UnitTestCase;
use Drupal\Tests\Core\DependencyInjection\Fixture\BarClass;
/**
* @coversDefaultClass \Drupal\Core\DependencyInjection\Container
* @group DependencyInjection
*/
class ContainerTest extends UnitTestCase {
/**
* Tests serialization.
*/
public function testSerialize() {
$container = new Container();
$this->expectException(\AssertionError::class);
serialize($container);
}
/**
* @covers ::set
*/
public function testSet() {
$container = new Container();
$class = new BarClass();
$container->set('bar', $class);
// Ensure that _serviceId is set on the object.
$this->assertEquals('bar', $class->_serviceId);
}
}