diff --git a/src/Dto/DataObject.php b/src/Dto/DataObject.php index 1d68d48fe..2d1565ebc 100644 --- a/src/Dto/DataObject.php +++ b/src/Dto/DataObject.php @@ -1,4 +1,5 @@ mockAssetAdapterInterface()); + $queryFactory = $this->getQueryFactory(); $this->expectExceptionMessage('Unknown query type: invalid'); $queryFactory->create('invalid'); } @@ -47,12 +48,34 @@ public function testInvalidQueryType(): void */ public function testAssetQueryType(): void { - $queryFactory = new QueryFactory($this->mockAssetAdapterInterface()); + $queryFactory = $this->getQueryFactory(); $query = $queryFactory->create('asset'); $this->assertInstanceOf(AssetQuery::class, $query); } + + /** + * @throws InvalidQueryTypeException + * @throws Exception + */ + public function testDataObjectQueryType(): void + { + $queryFactory = $this->getQueryFactory(); + $query = $queryFactory->create('dataObject'); + + $this->assertInstanceOf(DataObjectQuery::class, $query); + } + + + private function getQueryFactory(): QueryFactoryInterface + { + return new QueryFactory( + $this->mockAssetAdapterInterface(), + $this->mockDataObjectAdapterInterface() + ); + } + /** * @throws Exception */