Working state but no uploads

This commit is contained in:
julien
2026-03-16 02:33:18 +01:00
parent cc3fbdc830
commit 55d2da9f2f
52 changed files with 121 additions and 49 deletions

View File

@@ -27,6 +27,7 @@ use Tests\ControllerTestCase;
* - update() : 404, droits insuffisants, succès, erreur de validation
* - delete() : 404, droits insuffisants, succès
*/
#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
final class PostControllerTest extends ControllerTestCase
{
/** @var \Slim\Views\Twig&MockObject */
@@ -100,7 +101,7 @@ final class PostControllerTest extends ControllerTestCase
public function testIndexFiltersByCategoryWhenSlugProvided(): void
{
$category = new Category(3, 'PHP', 'php');
$this->categoryService->method('findBySlug')->with('php')->willReturn($category);
$this->categoryService->expects($this->once())->method('findBySlug')->with('php')->willReturn($category);
$this->postService->expects($this->once())
->method('getAllPosts')
@@ -233,7 +234,7 @@ final class PostControllerTest extends ControllerTestCase
public function testFormRendersFilledFormWhenUserIsAuthor(): void
{
$post = $this->buildPostEntity(7, 'Titre', 'Contenu', 'titre', 5);
$this->postService->method('getPostById')->with(7)->willReturn($post);
$this->postService->expects($this->once())->method('getPostById')->with(7)->willReturn($post);
$this->sessionManager->method('isAdmin')->willReturn(false);
$this->sessionManager->method('isEditor')->willReturn(false);
$this->sessionManager->method('getUserId')->willReturn(5);