Lines Matching refs:context
34 …this->anything(), $this->callback(static function (SerializationContext $context) use ($self, $obj…
37 if ($context->getObject() === $objects[0]) {
40 } elseif ($context->getObject() === $objects[1]) {
43 } elseif ($context->getObject() === $objects[2]) {
46 } elseif ($context->getObject() === $objects[3]) {
51 $self->assertEquals($expectedDepth, $context->getDepth(), 'shouldSkipClass depth');
52 $self->assertEquals($expectedPath, $context->getPath(), 'shouldSkipClass path');
60 …this->anything(), $this->callback(static function (SerializationContext $context) use ($self, $obj…
63 if ($context->getObject() === $objects[0]) {
66 } elseif ($context->getObject() === $objects[1]) {
69 } elseif ($context->getObject() === $objects[2]) {
72 } elseif ($context->getObject() === $objects[3]) {
77 … $self->assertEquals($expectedDepth, $context->getDepth(), 'shouldSkipProperty depth');
78 $self->assertEquals($expectedPath, $context->getPath(), 'shouldSkipProperty path');
99 …ack(static function (ClassMetadata $classMetadata, SerializationContext $context) use ($self, $obj…
100 $stack = $context->getMetadataStack();
102 if ($object === $context->getObject()) {
106 if ($child === $context->getObject()) {
117 …k(static function (PropertyMetadata $propertyMetadata, SerializationContext $context) use ($self) {
118 $stack = $context->getMetadataStack();
154 $context = SerializationContext::create();
156 $context->startVisiting($scalar);
157 self::assertFalse($context->isVisiting($scalar));
158 $context->stopVisiting($scalar);
163 $context = SerializationContext::create();
164 $context->setInitialType('foo');
165 self::assertEquals('foo', $context->getInitialType());
166 self::assertEquals('foo', $context->getAttribute('initial_type'));
168 $context = SerializationContext::create();
169 $context->setAttribute('initial_type', 'foo');
170 self::assertEquals('foo', $context->getInitialType());
177 $context = SerializationContext::create();
178 $context->setGroups(['foo', 'Default']);
179 $context->setGroups('post');
182 $serialized = $serializer->serialize($object, 'json', $context);
194 $context = SerializationContext::create();
195 $context->setVersion('1.0.1');
196 $context->setVersion('1.0.0');
199 $serialized = $serializer->serialize($object, 'json', $context);
208 $context = SerializationContext::create();
209 self::assertFalse($context->shouldSerializeNull());
211 $context->setSerializeNull(false);
212 self::assertFalse($context->shouldSerializeNull());
214 $context->setSerializeNull(true);
215 self::assertTrue($context->shouldSerializeNull());