tests and linting
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in -7s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in -16s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Failing after -3s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in -4s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 6s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in -41s

This commit is contained in:
2026-01-29 19:28:57 -05:00
parent e9cb49d942
commit 4ee830327e
20 changed files with 112 additions and 86 deletions

View File

@@ -1,47 +0,0 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\Tests\Events\Listeners;
use Illuminate\Database\Events\ConnectionEstablished;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LogLevel;
use Siteworxpro\App\Events\EventListeners\Database\Connected;
use Siteworxpro\App\Log\Logger;
use Siteworxpro\Tests\Unit;
class ConnectedTest extends Unit
{
/**
* @throws ContainerExceptionInterface
* @throws \ReflectionException
* @throws NotFoundExceptionInterface
*/
protected function setUp(): void
{
parent::setUp();
$inputBuffer = fopen('php://memory', 'r+');
$logger = new Logger(LogLevel::DEBUG, $inputBuffer);
\Siteworxpro\App\Services\Facades\Logger::getFacadeContainer()->bind(Logger::class, fn() => $logger);
}
public function testHandlesEvent()
{
$this->expectNotToPerformAssertions();
$connectedEvent = $this->createMock(ConnectionEstablished::class);
$listener = new Connected();
$listener->__invoke($connectedEvent);
}
public function testThrowsException()
{
$this->expectException(\TypeError::class);
$listener = new Connected();
$listener->__invoke(new \stdClass());
}
}