Skip to content

Commit

Permalink
Fixed service provider test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomadicjosh committed Dec 4, 2021
1 parent b1413b8 commit 722eb59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Tests/ServiceProvider/FakeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

class FakeServiceProvider extends BaseServiceProvider
{
public function register(ServiceContainer $container): void
public function register(): void
{
$container->alias('user.model', UserModel::class)
$this->container->alias('user.model', UserModel::class)
->define('user.model', [':userName' => new Person('Joseph Smith')]);
}
}
8 changes: 4 additions & 4 deletions Tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Qubus\Injector\Config\Factory;
use Qubus\Injector\Psr11\Container;
use Qubus\Injector\Injector;
use Qubus\Injector\Tests\ServiceProvider\FakeServiceProvider;
use Qubus\Injector\Tests\ServiceProvider\Person;

class ServiceProviderTest extends TestCase
{
public function testFakeServiceProvider()
{
$injector = new Container(Factory::create([]));
$injector = new Injector(Factory::create([]));

$service = new FakeServiceProvider();
$service->register($injector);
$service = new FakeServiceProvider($injector);
$service->register();

$name = new Person('Joseph Smith');

Expand Down

0 comments on commit 722eb59

Please sign in to comment.