Skip to content

Commit 139a547

Browse files
committed
Using consume method
1 parent 9dd4285 commit 139a547

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

tests/Functional/SearchIndex/AssetBasicTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public function testFolderIndexingAsynchronous()
8181
$folder->setKey('my-test-folder');
8282
$folder->save();
8383

84-
//Since the queue is processed asynchronously we need to run the worker here
85-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
84+
$this->tester->consume();
8685

8786
$this->assertGreaterThan(
8887
0,

tests/Functional/SearchIndex/DataObjectBasicTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ public function testIndexingWithInheritanceAsynchronous()
9999
$child = $this->createChildObject($object);
100100
$indexName = $this->dataObjectTypeAdapter->getAliasIndexName($object->getClass());
101101

102-
//Since the queue is processed asynchronously we need to run the worker here
103-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
102+
$this->tester->consume();
104103

105104
// check indexed
106105
$this->assertGreaterThan(
@@ -127,8 +126,7 @@ public function testIndexingWithInheritanceAsynchronousNoInheritance()
127126
$child = $this->createChildObject($object);
128127
$indexName = $this->dataObjectTypeAdapter->getAliasIndexName($object->getClass());
129128

130-
//Since the queue is processed asynchronously we need to run the worker here
131-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
129+
$this->tester->consume();
132130

133131
// check indexed
134132
$this->assertGreaterThan(
@@ -181,8 +179,7 @@ public function testIndexingWithoutInheritanceAsynchronous()
181179
$this->assertFalse($object->getClass()->getAllowInherit());
182180
$indexName = $this->dataObjectTypeAdapter->getAliasIndexName($object->getClass());
183181

184-
//Since the queue is processed asynchronously we need to run the worker here
185-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
182+
$this->tester->consume();
186183

187184
// check indexed
188185
$this->assertGreaterThan(
@@ -226,8 +223,7 @@ public function testFolderIndexingAsynchronous()
226223
$object->setKey('my-test-folder');
227224
$object->save();
228225

229-
//Since the queue is processed asynchronously we need to run the worker here
230-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
226+
$this->tester->consume();
231227

232228
$this->assertGreaterThan(
233229
0,

tests/Functional/SearchIndex/DocumentBasicTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public function testFolderIndexingAsynchronous()
8383
$folder->setKey('my-test-folder');
8484
$folder->save();
8585

86-
//Since the queue is processed asynchronously we need to run the worker here
87-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
86+
$this->tester->consume();
8887

8988
$this->assertGreaterThan(
9089
0,

tests/Functional/SearchIndex/IndexQueueTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public function testIndexQueueRepository(): void
7272

7373
TestHelper::createImageAsset();
7474

75-
//Since the queue is processed asynchronously we need to run the worker here
76-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
75+
$this->tester->consume();
7776

7877
$this->assertEquals(1, $indexQueueRepository->countIndexQueueEntries());
7978
$this->assertTrue($indexQueueRepository->dispatchableItemExists());
@@ -125,8 +124,7 @@ public function testAssetSaveProcessQueue(): void
125124

126125
$asset = TestHelper::createImageAsset();
127126

128-
//Since the queue is processed asynchronously we need to run the worker here
129-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
127+
$this->tester->consume();
130128

131129
$this->assertGreaterThan(
132130
0,
@@ -202,8 +200,7 @@ public function testDependenciesWithQueue(): void
202200
$object->setImage($asset);
203201
$object->save();
204202

205-
//Since the queue is processed asynchronously we need to run the worker here
206-
$this->tester->runCommand('messenger:consume', ['--limit'=>2], ['pimcore_generic_data_index_queue']);
203+
$this->tester->consume();
207204

208205
$assetIndex = $this->searchIndexConfigService->getIndexName(self::ASSET_INDEX_NAME);
209206
$objectIndex = $this->searchIndexConfigService->getIndexName($object->getClassName(), true);

0 commit comments

Comments
 (0)