From 3660fd7fea66d6d1b44cb99cdd2f8cbf39c91c8b Mon Sep 17 00:00:00 2001 From: Corentin R Date: Thu, 13 Jun 2024 08:04:16 +0200 Subject: [PATCH] Adding tests --- tests/unit-tests/CommentaryTest.php | 38 +++++++++++++++++++++++++++ tests/{ => unit-tests}/ProfilTest.php | 0 2 files changed, 38 insertions(+) create mode 100644 tests/unit-tests/CommentaryTest.php rename tests/{ => unit-tests}/ProfilTest.php (100%) diff --git a/tests/unit-tests/CommentaryTest.php b/tests/unit-tests/CommentaryTest.php new file mode 100644 index 0000000..0016520 --- /dev/null +++ b/tests/unit-tests/CommentaryTest.php @@ -0,0 +1,38 @@ +assertInstanceOf(Commentary::class, $commentary); + } + + public function test_text() + { + $commentary = new Commentary(); + $commentary->setText('Lorem ipsum'); + $this->assertEquals('Lorem ipsum', $commentary->getText()); + } + + public function test_post_association() + { + $commentary = new Commentary(); + $post = new Post(); // Assuming Post is properly defined + $commentary->setPost($post); + $this->assertInstanceOf(Post::class, $commentary->getPost()); + } + + public function test_profil_association() + { + $commentary = new Commentary(); + $profil = new Profil(); // Assuming Profil is properly defined + $commentary->setProfil($profil); + $this->assertInstanceOf(Profil::class, $commentary->getProfil()); + } +} diff --git a/tests/ProfilTest.php b/tests/unit-tests/ProfilTest.php similarity index 100% rename from tests/ProfilTest.php rename to tests/unit-tests/ProfilTest.php