Basic CLI API integration of gettings weather of any city.
- Clone git repository in your server.
- Create
.env
by copy from.env.example
. - Set API credentials and details in
.env
file. - In Console, go to your project directory, install composer and run command
composer install
. - Set executable permission on weather file. run command
chmod 755 weather
for that. - Now Run the API with command
./weather London
- Run unit-test with created docker image
docker run 1208198602081986/img-weather-cli-app:weatherapp
./vendor/bin/phpunit --bootstrap tests/bootstrap.php tests
run in console to run the unit-tests.
- php-cli (= 7.4)
- docker
Note: I am mentioning only files/folders which you need to configure if required
├── app
│ ├── Commands
│ │ ├── GetWeatherCommand.php
│ ├── Exception
│ │ ├── WeatherException.php
│ ├── bootstrap.php
├── config
│ ├── app.php
├── tests
│ ├── App
│ │ ├── Commands
│ │ │ ├── Mock
│ │ │ │ ├── Cityweather
│ │ │ │ │ ├── invalid-cityname-weather-response-body.json
│ │ │ │ │ ├── weather-response-body.json
│ │ │ └── GetWeatherCommandWithMockTest.php
│ │ │ └── GetWeatherCommandWithoutMockTest.php
│ ├── bootstrap.php
│ ├── phpunit.xml.dist
├── .env
├── .env.example
├── .gitignore
├── composer.json
├── composer.lock
├── README.md
├── Dockerfile
- Write to [email protected]