Move controller tests to handler tests, update the factory methods to conform to the interface.

This commit is contained in:
Dave Smith-Hayes 2025-04-23 21:18:44 -04:00
parent 7e0285f9b5
commit ecb7cc395c
3 changed files with 7 additions and 3 deletions

View File

@ -36,7 +36,11 @@ class UserFactory implements FactoryInterface
return $user; return $user;
} }
public static function toArray(User $user): array /**
* @param User $user
* @return array
*/
public static function toArray($user): array
{ {
return [ return [
'name' => $user->getName(), 'name' => $user->getName(),

View File

@ -7,7 +7,7 @@ use Slovocast\Handler\Handler;
use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ResponseInterface as Response;
use Odan\Session\SessionInterface; use Odan\Session\SessionInterface;
class ControllerTest extends TestCase class HandlerTest extends TestCase
{ {
public function testHtmlInlineResponse(): void public function testHtmlInlineResponse(): void
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Slovocast\Tests\Controller\User; namespace Slovocast\Tests\Handler\User;
use Slovocast\Domain\Factory\UserFactory; use Slovocast\Domain\Factory\UserFactory;
use Slovocast\Tests\TestCase; use Slovocast\Tests\TestCase;