Skip to content

Commit

Permalink
Merge pull request #2 from nikapps/add-travis
Browse files Browse the repository at this point in the history
Add travis ci
  • Loading branch information
alibo authored Sep 20, 2018
2 parents 2dd487b + 2c71e24 commit 67887d5
Show file tree
Hide file tree
Showing 9 changed files with 1,927 additions and 12 deletions.
15 changes: 15 additions & 0 deletions .docker/nginx/app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 0.0.0.0:80;

root /app;

location / {
try_files $uri $uri/index.php;
}

location ~ \.php$ {
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sudo: required

language: php

php:
- 7.2

services:
- docker

cache:
directories:
- $HOME/.composer/cache

before_install:
- phpenv config-rm xdebug.ini
- travis_retry composer self-update
- docker-compose -f docker-compose.testing.yaml up -d

before_script:
- composer install --no-interaction --no-suggest

script:
- vendor/bin/phpspec run
- vendor/bin/codecept run
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
===================
**Obsolete package - payment with USSD is forbidden by Iranian central bank ([more info](http://khabaronline.ir/%28X%281%29S%28dja55emvz22zzic1fn5qleqc%29%29/detail/464534/Economy/macroeconomics))**

[![Travis (.org) branch](https://img.shields.io/travis/:user/:repo/:branch.svg?style=flat-square)](https://github.com/nikapps/saman-ussd/) [![Latest Stable Version](https://poser.pugx.org/nikapps/saman-ussd/v/stable)](https://packagist.org/packages/nikapps/saman-ussd) [![License](https://poser.pugx.org/nikapps/saman-ussd/license)](https://packagist.org/packages/nikapps/saman-ussd)
<img title="Saman *724*" alt="Saman *724*" src="http://www.724sep.ir/Content/image/mobile.png" height="200">

A php package for connecting to [Saman *724#](http://www.724sep.ir/) payment gateway.
Expand Down Expand Up @@ -338,17 +339,17 @@ vendor/bin/phpspec run

#### Api test

Change default `endpoint` in
`tests/api.suite.yml` and `tests/api/webservice.php`
Run:

Then run:
~~~bash
docker-compose -f docker-compose.testing.yaml up -d

~~~
vendor/bin/codecept run
~~~

## Dependencies

- `php >= 7.1`
- `piotrooo/wsdl-creator`

Dev dependencies:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"require-dev": {
"phpspec/phpspec": "^2.2",
"phpunit/phpunit": "4.*",
"codeception/codeception": "2.0.*"
"codeception/codeception": "^2.4"
}
}
18 changes: 18 additions & 0 deletions docker-compose.testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'
services:
phpfpm:
tty: true
image: 'bitnami/php-fpm:7.2'
ports:
- 9000:9000
volumes:
- .:/app

web:
image: 'nginx:alpine'
depends_on:
- phpfpm
ports:
- '8000:80'
volumes:
- ./.docker/nginx/:/etc/nginx/conf.d/
26 changes: 26 additions & 0 deletions tests/_support/ApiTester.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php


/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
*
* @SuppressWarnings(PHPMD)
*/
class ApiTester extends \Codeception\Actor
{
use _generated\ApiTesterActions;

/**
* Define custom actions here
*/
}
Loading

0 comments on commit 67887d5

Please sign in to comment.