Skip to content

Commit

Permalink
fix unit tests due to the laminas/servicemanager upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Böhringer <dev@tboehringer.de>
  • Loading branch information
tomboe311 committed Jul 9, 2024
1 parent 5ae3125 commit 3801bd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions test/unit/Adapter/AdapterAbstractServiceFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Db\Adapter;

use Laminas\Db\Adapter\Adapter;
use Laminas\Db\Adapter\AdapterAbstractServiceFactory;
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\ServiceManager;
Expand All @@ -18,11 +19,11 @@ class AdapterAbstractServiceFactoryTest extends TestCase
protected function setUp(): void
{
$this->serviceManager = new ServiceManager();

$config = new Config([
'abstract_factories' => [AdapterAbstractServiceFactory::class],
]);
$config->configureServiceManager($this->serviceManager);
$this->serviceManager->configure(
[
'abstract_factories' => [AdapterAbstractServiceFactory::class],
]
);

$this->serviceManager->setService('config', [
'db' => [
Expand Down
3 changes: 2 additions & 1 deletion test/unit/Adapter/AdapterServiceDelegatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public function testDelegatorWithPluginManager()

/** @var AbstractSingleInstancePluginManager $pluginManager */
$pluginManager = new class ($container, $pluginManagerConfig) extends AbstractSingleInstancePluginManager {
protected string $instanceOf = ConcreteAdapterAwareObject::class;
};

$options = [
Expand All @@ -219,7 +220,7 @@ public function testDelegatorWithPluginManager()
];

/** @var ConcreteAdapterAwareObject $result */
$result = $pluginManager->get(
$result = $pluginManager->build(
ConcreteAdapterAwareObject::class,
$options
);
Expand Down

0 comments on commit 3801bd3

Please sign in to comment.