@@ 19-33 (lines=15) @@ | ||
16 | */ |
|
17 | class SerializerTest extends WebTestCase |
|
18 | { |
|
19 | public function testMappingIteratorToArrayField() |
|
20 | { |
|
21 | $client = $this->createClient(array('test_case' => 'Serializer')); |
|
22 | $persister = $client->getContainer()->get('fos_elastica.object_persister.index.type'); |
|
23 | ||
24 | $object = new TypeObj(); |
|
25 | $object->id = 1; |
|
26 | $object->coll = new \ArrayIterator(array('foo', 'bar')); |
|
27 | $persister->insertOne($object); |
|
28 | ||
29 | $object->coll = new \ArrayIterator(array('foo', 'bar', 'bazz')); |
|
30 | $object->coll->offsetUnset(1); |
|
31 | ||
32 | $persister->replaceOne($object); |
|
33 | } |
|
34 | ||
35 | /** |
|
36 | * Tests that the serialize_null configuration attribute works |
@@ 86-100 (lines=15) @@ | ||
83 | $this->assertNotEmpty($mapping, 'Mapping was populated'); |
|
84 | } |
|
85 | ||
86 | public function testMappingIteratorToArrayField() |
|
87 | { |
|
88 | $client = $this->createClient(array('test_case' => 'ORM')); |
|
89 | $persister = $client->getContainer()->get('fos_elastica.object_persister.index.type'); |
|
90 | ||
91 | $object = new TypeObj(); |
|
92 | $object->id = 1; |
|
93 | $object->coll = new \ArrayIterator(array('foo', 'bar')); |
|
94 | $persister->insertOne($object); |
|
95 | ||
96 | $object->coll = new \ArrayIterator(array('foo', 'bar', 'bazz')); |
|
97 | $object->coll->offsetUnset(1); |
|
98 | ||
99 | $persister->replaceOne($object); |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * @param Client $client |