public function testGetCode()
 {
     $definitionBuilder = new DefinitionBuilder(new ParameterBuilder());
     $definitionBuilder->addDefinition(Car::class)->defineIsSingleton()->defineConstructor()->defineParameter('driver')->defineDependency(new ClassReference(SlowDriver::class))->end()->end()->defineProperty('driver')->defineDependency(new ClassReference(SlowDriver::class))->end()->end()->addDefinition(WheelController::class)->defineConstructor()->defineParameter('fastDriver')->defineDependency(new ClassReference(SlowDriver::class))->end()->defineParameter('slowDriver')->defineDependency(new ClassReference(SlowDriver::class))->end()->defineParameter('car')->defineDependency(new ClassReference(Car::class))->end()->defineParameter('params')->defineDependency((new CollectionReference([CollectionItem::create(new ConstantReference('PHP_VERSION'), 1), 'key0' => 33, 'key1' => new ConstantReference('PHP_MAJOR_VERSION'), 'kye2' => new StringReference('value'), 1 => 5555]))->addItem(CollectionItem::create(2, new ConstantReference('PHP_MINOR_VERSION')))->addItem(CollectionItem::create(3, 'sdf'))->addItem(CollectionItem::create('key3', 'dsddd')))->end()->defineParameter('id')->defineDependency(new ConstantReference('PHP_RELEASE_VERSION'))->end()->end()->defineMethod('setLeg')->defineParameter('leg')->defineDependency(new ClassReference(Leg::class))->end()->end()->defineProperty('car')->defineDependency(new ClassReference(Car::class))->end()->end()->addDefinition(ProductClass::class)->defineConstructor()->end()->end();
     $compiler = new DefinitionCompiler(new DefinitionGenerator(new ClassGenerator()), $this->getAnalyzer());
     $namespace = (new \ReflectionClass(self::class))->getNamespaceName();
     /** @var ContainerInterface $container */
     $container = $compiler->compile($definitionBuilder, 'ContainerGeneratorTest', $namespace, __DIR__ . '/../generated');
     static::assertInstanceOf(WheelController::class, $container->get(WheelController::class));
 }
 public function testConstructor()
 {
     $item = new CollectionItem(new StringReference('key'), new StringReference('value'));
     static::assertInstanceOf(StringReference::class, $item->getKey());
     static::assertInstanceOf(StringReference::class, $item->getValue());
 }
 public function testConstructor()
 {
     $collection1 = new CollectionReference([CollectionItem::create('key1', 'value')]);
     static::assertCount(1, $collection1->getCollection());
     static::assertInstanceOf(StringReference::class, $collection1->getCollection()[0]->getKey());
 }