$this->bundleWithSchemas =
$this->
createMock(Bundle::
class);
$this->bundleWithSchemas->
method('getPath'
)->
willReturn(__DIR__ . '/_fixtures/BundleWithApiSchema'
);
$this->bundleWithoutSchemas =
$this->
createMock(Bundle::
class);
$this->bundleWithoutSchemas->
method('getPath'
)->
willReturn(__DIR__ . '/_fixtures/BundleWithoutApiSchema'
);
$this->customBundleSchemas =
new ShopwareBundleWithName();
} public function testGetPathsForStoreApi(): void
{ $factory =
new BundleSchemaPathCollection([$this->bundleWithSchemas,
$this->bundleWithoutSchemas
]);
$paths =
$factory->
getSchemaPaths(DefinitionService::STORE_API, null
);
static::
assertContains(__DIR__ . '/_fixtures/BundleWithApiSchema/Resources/Schema/StoreApi',
$paths);
static::
assertNotContains(__DIR__ . '/_fixtures/BundleWithoutApiSchema/Resources/Schema/StoreApi',
$paths);
} public function testGetPathsForAdminApi(): void
{ $factory =
new BundleSchemaPathCollection([$this->bundleWithSchemas,
$this->bundleWithoutSchemas
]);
$paths =
$factory->
getSchemaPaths(DefinitionService::API, null
);
static::
assertContains(__DIR__ . '/_fixtures/BundleWithApiSchema/Resources/Schema/AdminApi',
$paths);
static::
assertNotContains(__DIR__ . '/_fixtures/BundleWithoutApiSchema/Resources/Schema/AdminApi',
$paths);
}