Working state but no uploads
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user