@@ 25-35 (lines=11) @@ | ||
22 | ||
23 | class SolrIndexTest extends SapphireTest |
|
24 | { |
|
25 | public function testFieldDataHasOne() |
|
26 | { |
|
27 | $index = new SolrIndexTest_FakeIndex(); |
|
28 | $data = $index->fieldData('HasOneObject.Field1'); |
|
29 | ||
30 | $data = $data[SearchUpdaterTest_Container::class . '_HasOneObject_Field1']; |
|
31 | ||
32 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['origin']); |
|
33 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['base']); |
|
34 | $this->assertEquals(SearchUpdaterTest_HasOne::class, $data['class']); |
|
35 | } |
|
36 | ||
37 | public function testFieldDataHasMany() |
|
38 | { |
|
@@ 37-46 (lines=10) @@ | ||
34 | $this->assertEquals(SearchUpdaterTest_HasOne::class, $data['class']); |
|
35 | } |
|
36 | ||
37 | public function testFieldDataHasMany() |
|
38 | { |
|
39 | $index = new SolrIndexTest_FakeIndex(); |
|
40 | $data = $index->fieldData('HasManyObjects.Field1'); |
|
41 | $data = $data[SearchUpdaterTest_Container::class . '_HasManyObjects_Field1']; |
|
42 | ||
43 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['origin']); |
|
44 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['base']); |
|
45 | $this->assertEquals(SearchUpdaterTest_HasMany::class, $data['class']); |
|
46 | } |
|
47 | ||
48 | public function testFieldDataManyMany() |
|
49 | { |
|
@@ 48-57 (lines=10) @@ | ||
45 | $this->assertEquals(SearchUpdaterTest_HasMany::class, $data['class']); |
|
46 | } |
|
47 | ||
48 | public function testFieldDataManyMany() |
|
49 | { |
|
50 | $index = new SolrIndexTest_FakeIndex(); |
|
51 | $data = $index->fieldData('ManyManyObjects.Field1'); |
|
52 | $data = $data[SearchUpdaterTest_Container::class . '_ManyManyObjects_Field1']; |
|
53 | ||
54 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['origin']); |
|
55 | $this->assertEquals(SearchUpdaterTest_Container::class, $data['base']); |
|
56 | $this->assertEquals(SearchUpdaterTest_ManyMany::class, $data['class']); |
|
57 | } |
|
58 | ||
59 | public function testFieldDataAmbiguousHasMany() |
|
60 | { |