feat: enhance service providers with provides method and integrate command bus in handlers
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 2m40s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m42s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 2m53s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 2m55s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 2m42s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m24s

This commit is contained in:
2025-12-22 13:18:13 -05:00
parent cae1de6ef3
commit de0c95db2a
17 changed files with 107 additions and 60 deletions

View File

@@ -28,16 +28,16 @@ abstract class AbstractServiceProvider extends Unit
$this->assertInstanceOf($providerClass, $provider);
$provider->register();
$bindings = $provider->bindings;
foreach ($bindings as $abstract => $concrete) {
$this->assertTrue($container->bound($abstract), "The $abstract is not bound in the container.");
$this->assertNotNull($container->make($abstract), "The $abstract could not be resolved.");
$abstract = $provider->provides()[0];
$concrete = get_class($container->make($abstract));
$this->assertInstanceOf(
$concrete,
$container->make($abstract),
"The $abstract is not an instance of $concrete."
);
}
$this->assertTrue($container->bound($abstract), "The $abstract is not bound in the container.");
$this->assertNotNull($container->make($abstract), "The $abstract could not be resolved.");
$this->assertInstanceOf(
$concrete,
$container->make($abstract),
"The $abstract is not an instance of $concrete."
);
}
}