Skip to content

Commit a345855

Browse files
committed
TASK: Move expected exceptions from annotations to method calls
1 parent 202bab8 commit a345855

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Tests/Unit/Eel/ElasticSearchQueryBuilderTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ public function basicRequestStructureTakesContextNodeIntoAccount(): void
169169

170170
/**
171171
* @test
172-
* @expectedException \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\QueryBuildingException
173172
*/
174173
public function queryFilterThrowsExceptionOnInvalidClauseType(): void
175174
{
175+
$this->expectException( QueryBuildingException::class);
176176
$this->queryBuilder->queryFilter('foo', [], 'unsupported');
177177
}
178178

@@ -365,20 +365,22 @@ public function anAggregationCanBeSubbedUnderAPath(): void
365365

366366
/**
367367
* @test
368-
* @expectedException \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\QueryBuildingException
369368
*/
370369
public function ifTheParentPathDoesNotExistAnExceptionisThrown(): void
371370
{
371+
$this->expectException(QueryBuildingException::class);
372+
372373
$this->queryBuilder->fieldBasedAggregation('foo', 'bar');
373374
$this->queryBuilder->fieldBasedAggregation('bar', 'bar', 'terms', 'doesNotExist');
374375
}
375376

376377
/**
377378
* @test
378-
* @expectedException \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\QueryBuildingException
379379
*/
380380
public function ifSubbedParentPathDoesNotExistAnExceptionisThrown(): void
381381
{
382+
$this->expectException(QueryBuildingException::class);
383+
382384
$this->queryBuilder->fieldBasedAggregation('foo', 'bar');
383385
$this->queryBuilder->fieldBasedAggregation('bar', 'bar', 'terms', 'foo.doesNotExist');
384386
}

0 commit comments

Comments
 (0)