$collection =
new ExtensionCollection();
$collection->
set('myPlugin',
(new ExtensionStruct())->
assign(['name' => 'myPlugin', 'label' => 'Label', 'version' => '1.0.0'
]));
$collection =
$this->extensionListingLoader->
load($collection,
$this->
createAdminStoreContext());
static::
assertCount(1,
$collection);
} public function testExternalAreAdded(): void
{ $this->
getRequestHandler()->
reset();
$this->
getRequestHandler()->
append(new Response(200,
[], '{"data":[]}'
));
$this->
getRequestHandler()->
append(new Response(200,
[],
$this->
getLicencesJson()));
$collection =
new ExtensionCollection();
$collection->
set('myPlugin',
(new ExtensionStruct())->
assign(['name' => 'myPlugin', 'label' => 'Label', 'version' => '1.0.0', 'active' => true
]));
$collection->
set('myPlugin2',
(new ExtensionStruct())->
assign(['name' => 'myPlugin2', 'label' => 'Label', 'version' => '1.0.0', 'installedAt' =>
new \
DateTime()]));
$collection =
$this->extensionListingLoader->
load($collection,
$this->
createAdminStoreContext());
/** @var ExtensionStruct $extension */
$extension =
$collection->
get('SwagApp'
);
static::
assertSame('app',
$extension->
getType());
static::
assertSame('store',
$extension->
getSource());
static::
assertCount(8,
$collection);
}