You've already forked Php-Template
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
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:
@@ -4,23 +4,31 @@ declare(strict_types=1);
|
||||
|
||||
namespace Siteworxpro\Tests\Controllers;
|
||||
|
||||
use League\Tactician\CommandBus;
|
||||
use Siteworxpro\App\Controllers\IndexController;
|
||||
|
||||
class IndexControllerTest extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @throws \JsonException
|
||||
* @throws \JsonException|\ReflectionException
|
||||
*/
|
||||
public function testGet(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
|
||||
$this->getContainer()->bind(CommandBus::class, function () {
|
||||
return \Mockery::mock(CommandBus::class)
|
||||
->shouldReceive('handle')
|
||||
->andReturn('Hello World')
|
||||
->getMock();
|
||||
});
|
||||
|
||||
$controller = new IndexController();
|
||||
|
||||
$response = $controller->get($this->getMockRequest());
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEquals('{"message":"Server is running"}', (string)$response->getBody());
|
||||
$this->assertEquals('{"message":"Server is running. Hello World"}', (string)$response->getBody());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user