|
8 | 8 | use DirectoryTree\OpenSearchAdapter\Indices\Settings; |
9 | 9 | use DirectoryTree\OpenSearchAdapter\Testing\Fakes\FakeIndexManager; |
10 | 10 |
|
11 | | -test('fake index manager implements the index manager contract', function () { |
| 11 | +it('implements the index manager contract', function () { |
12 | 12 | expect(new FakeIndexManager)->toBeInstanceOf(IndexManagerInterface::class); |
13 | 13 | }); |
14 | 14 |
|
15 | | -test('fake index manager tracks index existence', function () { |
| 15 | +it('tracks index existence', function () { |
16 | 16 | $indices = new FakeIndexManager; |
17 | 17 |
|
18 | 18 | expect($indices->exists('posts'))->toBeFalse(); |
|
24 | 24 | expect($indices->exists('posts'))->toBeTrue(); |
25 | 25 | }); |
26 | 26 |
|
27 | | -test('fake index manager records created indices', function () { |
| 27 | +it('records created indices', function () { |
28 | 28 | $indices = new FakeIndexManager; |
29 | 29 |
|
30 | 30 | $indices->create($index = new IndexBlueprint( |
|
38 | 38 | expect($indices->exists('posts'))->toBeTrue(); |
39 | 39 | }); |
40 | 40 |
|
41 | | -test('fake index manager records mapping updates', function () { |
| 41 | +it('records mapping updates', function () { |
42 | 42 | $indices = new FakeIndexManager; |
43 | 43 |
|
44 | 44 | $indices->putMapping('posts', $mapping = (new Mapping)->keyword('status')); |
45 | 45 |
|
46 | 46 | $indices->assertMappingPut('posts', $mapping); |
47 | 47 | }); |
48 | 48 |
|
49 | | -test('fake index manager records settings updates', function () { |
| 49 | +it('records settings updates', function () { |
50 | 50 | $indices = new FakeIndexManager; |
51 | 51 |
|
52 | 52 | $indices->putSettings('posts', $settings = (new Settings)->index(['refresh_interval' => -1])); |
53 | 53 |
|
54 | 54 | $indices->assertSettingsPut('posts', $settings); |
55 | 55 | }); |
56 | 56 |
|
57 | | -test('fake index manager records open and close operations', function () { |
| 57 | +it('records open and close operations', function () { |
58 | 58 | $indices = new FakeIndexManager; |
59 | 59 |
|
60 | 60 | $indices |
|
64 | 64 | ->assertOpened('posts'); |
65 | 65 | }); |
66 | 66 |
|
67 | | -test('fake index manager records deleted indices', function () { |
| 67 | +it('records deleted indices', function () { |
68 | 68 | $indices = new FakeIndexManager(existing: ['posts']); |
69 | 69 |
|
70 | 70 | $indices->delete('posts'); |
|
74 | 74 | expect($indices->exists('posts'))->toBeFalse(); |
75 | 75 | }); |
76 | 76 |
|
77 | | -test('fake index manager records aliases', function () { |
| 77 | +it('records aliases', function () { |
78 | 78 | $indices = new FakeIndexManager; |
79 | 79 |
|
80 | 80 | $alias = new Alias('published_posts', [ |
|
90 | 90 | ]); |
91 | 91 | }); |
92 | 92 |
|
93 | | -test('fake index manager records deleted aliases', function () { |
| 93 | +it('records deleted aliases', function () { |
94 | 94 | $indices = new FakeIndexManager; |
95 | 95 |
|
96 | 96 | $indices->putAlias('posts', new Alias('published_posts')); |
|
102 | 102 | expect($indices->getAliases('posts'))->toBe([]); |
103 | 103 | }); |
104 | 104 |
|
105 | | -test('fake index manager applies atomic alias updates', function () { |
| 105 | +it('applies atomic alias updates', function () { |
106 | 106 | $indices = new FakeIndexManager(existing: [ |
107 | 107 | 'posts_blue', |
108 | 108 | 'posts_green', |
|
0 commit comments