maurobonfietti / slim4-api-skeleton

Useful skeleton for RESTful API development with PHP and Slim 4.
http://bit.ly/2nNNOZi
MIT License
132 stars 32 forks source link

composer test not working #29

Closed andreizah97 closed 4 years ago

andreizah97 commented 4 years ago

.F. 3 / 3 (100%)

Time: 00:00.045, Memory: 6.00 MB

There was 1 failure:

1) Tests\integration\HomeControllerTest::testStatus Failed asserting that 500 matches expected 200.

D:\xampp\htdocs\PW_project\tests\integration\HomeControllerTest.php:28

FAILURES! Tests: 3, Assertions: 10, Failures: 1. PHP Warning: Version warning: Imagick was compiled against ImageMagick version 1799 but version 1802 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0 Script phpunit handling the test event returned with error code 1

maurobonfietti commented 4 years ago

Hello @andreizah97

Check your dotenv file: .env:

DB_HOST='127.0.0.1'
DB_NAME='your_database'
DB_USER='root'
DB_PASS=''

And then check your MySQL connection.

(You should have a MySQL database with the name of DB_NAME )

Let me know if you need more help.

andreizah97 commented 4 years ago

Could you help me with a project for school, i never used slim and i have to do it by tomorrow, i have the base html and php files, everything works but i have to make an api and my professor told me to use slim, sorry if i'm asking too much. thanks

HRankit commented 4 years ago

Could you help me with a project for school, i never used slim and i have to do it by tomorrow, i have the base html and php files, everything works but i have to make an api and my professor told me to use slim, sorry if i'm asking too much. thanks

@andreizah97 Use Slim 3. Until Slim 4 was launched I used to use this for any new project https://github.com/tuupola/slim-api-skeleton Almost everything is ready to be used.

andreizah97 commented 4 years ago

i have to use xampp and imagick bc my app should have an image database and from the database modify a picture with imagick and save it back to database, imagick was pretty hard to install and i don't want to try that again and i should use sqlite3

andreizah97 commented 4 years ago

Hello @andreizah97

Check your dotenv file: .env:

DB_HOST='127.0.0.1'
DB_NAME='your_database'
DB_USER='root'
DB_PASS=''

And then check your MySQL connection.

(You should have a MySQL database with the name of DB_NAME )

Let me know if you need more help. i've created a database in phpmyadmin and it works now thanks

maurobonfietti commented 4 years ago

i've created a database in phpmyadmin and it works now thanks

I'm glad to help you. Good luck!