From bec9aed97673c9dd3180124db6031884da005fdf Mon Sep 17 00:00:00 2001 From: Patton Date: Wed, 6 Dec 2023 10:20:28 -0500 Subject: [PATCH 1/3] updated readme --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index eaed2c3..6e1869b 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,24 @@ Therefore, when writing or updating these tests, it's crucial to ensure that the In other words, if you're writing a test to update or delete a song that you've just inserted into the database for testing purposes, you need to know the song_id that was assigned to that song and use it in your test. If the song_id in the test doesn't match any song_id in the database, the test will fail because it can't find the song it's supposed to update or delete. ``` -'id' => '53', -'username' => 'test_admin', -'song_artist' => 'test_admin', -'song_name' => 'admin_song', -'song_rating' => '4', +public function testUpdateSong(): void +{ + ... + 'id' => '53', + 'username' => 'test_admin', + 'song_artist' => 'test_admin', + 'song_name' => 'admin_song', + 'song_rating' => '4', + ... +} ``` ``` -'id' => '53', -'username' => 'test_admin', +public function testDeleteSong(): void +{ + ... + 'id' => '53', + 'username' => 'test_admin', + ... +} ``` From f176184ebf9c49494c5dfa97d28d2062b63049f2 Mon Sep 17 00:00:00 2001 From: Patton Date: Wed, 6 Dec 2023 10:40:54 -0500 Subject: [PATCH 2/3] updated readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e1869b..ceda5f7 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,7 @@ cd backend ### Hard coded id (song_id), username, password -For testRegister, testLogin, testFailLogin: -the unsername and password are hard coded, make sure such user doesn't exist in the database before the test. +For the testRegister, testLogin, and testFailLogin tests, the username and password are pre-defined in the test code. To ensure these tests run correctly, verify that the user defined by these credentials does not already exist in the database prior to running the tests. ``` 'username' => 'test_admin', From ff74385f2462f4d5bc28085f042282acd5116b2f Mon Sep 17 00:00:00 2001 From: Patton Date: Wed, 6 Dec 2023 10:47:06 -0500 Subject: [PATCH 3/3] added readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ceda5f7..63d17ad 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ In addition to the back up, we also have codes related to Unit Testing and Continuous Integration(Python pytest, Jest, PHPUnit, GitHub Actions, Generative AI) for COMP 333: Software Engineering 2023 Homework 5 +## Where to put the repo + +Make sure that you've cloned the repository to the folder htdocs in XAMPP. Otherwise, the php test might not run. + ## Python test ### Problem 1 (unit test without pytest)