File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
Tests/Functional/DependencyInjection Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+
4+ namespace FOS \ElasticaBundle \Tests \Functional \DependencyInjection ;
5+
6+
7+ use FOS \ElasticaBundle \DependencyInjection \FOSElasticaExtension ;
8+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
9+ use Symfony \Component \Yaml \Yaml ;
10+
11+ class FOSElasticaExtensionTest extends \PHPUnit_Framework_TestCase
12+ {
13+
14+ /**
15+ * @test
16+ */
17+ public function shouldAddParentParamToObjectPersisterCall ()
18+ {
19+
20+ $ config = Yaml::parse (file_get_contents (__DIR__ .'/config/config.yml ' ));
21+
22+ $ containerBuilder = new ContainerBuilder ;
23+ $ containerBuilder ->setParameter ('kernel.debug ' , true );
24+
25+ $ extension = new FOSElasticaExtension ;
26+
27+ $ extension ->load ($ config , $ containerBuilder );
28+
29+ $ this ->assertTrue ($ containerBuilder ->hasDefinition ('fos_elastica.object_persister.test_index.child_field ' ));
30+
31+ $ persisterCallDefinition = $ containerBuilder ->getDefinition ('fos_elastica.object_persister.test_index.child_field ' );
32+
33+ $ this ->assertArrayHasKey ('_parent ' , $ persisterCallDefinition ->getArguments ()['index_3 ' ]);
34+ }
35+
36+ }
Original file line number Diff line number Diff line change 1+ fos_elastica :
2+ clients :
3+ default :
4+ url : http://localhost:9200
5+ indexes :
6+ test_index :
7+ client : default
8+ types :
9+ parent_field :
10+ mappings :
11+ text : ~
12+ persistence :
13+ driver : orm
14+ model : foo_model
15+ child_field :
16+ mappings :
17+ text : ~
18+ persistence :
19+ driver : orm
20+ model : foo_model
21+ _parent : { type: "parent_field", property: "parent" }
You can’t perform that action at this time.
0 commit comments