Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Move to 'damax-solutions' org.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakiboy committed Feb 17, 2019
1 parent 2666769 commit 1e1b39f
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 71 deletions.
34 changes: 18 additions & 16 deletions .travis.yml
Expand Up @@ -3,33 +3,35 @@ sudo: false
language: php

php:
- 7.1
- 7.2
- 7.1
- 7.2
- 7.3

services:
- mongodb
- mongodb

env:
global:
- SYMFONY_PHPUNIT_VERSION=6.5
- SYMFONY_LOWEST=
global:
- SYMFONY_PHPUNIT_VERSION=7.4
- SYMFONY_LOWEST=

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

matrix:
include:
- php: 7.1
env: SYMFONY_LOWEST="3.4.*"
include:
- php: 7.1
env: SYMFONY_LOWEST="3.4.*"

install:
- pecl install -f mongodb-stable
- composer install --prefer-dist
- if [ "$SYMFONY_LOWEST" != "" ]; then composer require symfony/framework-bundle:$SYMFONY_LOWEST symfony/security-bundle:$SYMFONY_LOWEST --dev; fi
- pecl install -f mongodb-stable
- composer install --prefer-dist
- if [ "$SYMFONY_LOWEST" != "" ]; then composer require symfony/framework-bundle:$SYMFONY_LOWEST symfony/security-bundle:$SYMFONY_LOWEST --dev; fi

script:
- composer test-ci
- vendor/bin/php-cs-fixer fix --dry-run --diff
- vendor/bin/simple-phpunit --coverage-clover=build/logs/clover.xml

after_script:
- composer test-publish
- vendor/bin/php-coveralls
36 changes: 36 additions & 0 deletions Makefile
@@ -0,0 +1,36 @@
DOCKER_RUN = docker-compose run --rm composer

all: install test
.PHONY: all

install:
$(DOCKER_RUN) install
.PHONY: install

update:
$(DOCKER_RUN) update
.PHONY: update

cs:
$(DOCKER_RUN) run-script cs
.PHONY: cs

test: wait-for-mongo
$(DOCKER_RUN) run-script test
.PHONY: test

test-cc: wait-for-mongo
$(DOCKER_RUN) run-script test-cc
.PHONY: test-cc

wait-for-mongo:
docker-compose run --rm dockerize -wait tcp://mongo:27017 -timeout 1m
.PHONY: wait-for-mongo

require:
$(DOCKER_RUN) require $(package)
.PHONY: require

require-dev:
$(DOCKER_RUN) require --dev $(package)
.PHONY: require-dev
11 changes: 9 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# Damax Chargeable API

[![Build Status](https://travis-ci.org/lakiboy/damax-chargeable-api.svg?branch=master)](https://travis-ci.org/lakiboy/damax-chargeable-api) [![Coverage Status](https://coveralls.io/repos/lakiboy/damax-chargeable-api/badge.svg?branch=master&service=github)](https://coveralls.io/github/lakiboy/damax-chargeable-api?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lakiboy/damax-chargeable-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lakiboy/damax-chargeable-api/?branch=master)
[![Build Status](https://travis-ci.org/damax-solutions/php-chargeable-api.svg?branch=master)](https://travis-ci.org/damax-solutions/php-chargeable-api) [![Coverage Status](https://coveralls.io/repos/damax-solutions/php-chargeable-api/badge.svg?branch=master&service=github)](https://coveralls.io/github/damax-solutions/php-chargeable-api?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/damax-solutions/php-chargeable-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/damax-solutions/php-chargeable-api/?branch=master)

Charge credit for API calls. Provides integration with [Symfony Framework](https://github.com/symfony/symfony).

Expand All @@ -23,4 +23,11 @@ Topics:
- [Concepts](doc/concepts.md)
- [Configuration](doc/configuration.md)
- [Usage](doc/usage.md)
- [Development](doc/development.md)

## Contribute

Install dependencies and run tests:

```bash
$ make
```
8 changes: 0 additions & 8 deletions bin/phpunit-coverage

This file was deleted.

18 changes: 8 additions & 10 deletions composer.json
Expand Up @@ -3,17 +3,11 @@
"type": "library",
"description": "Charge credit for API calls.",
"license": "MIT",
"autoload": {
"psr-4": { "Damax\\ChargeableApi\\": "src" }
},
"autoload-dev": {
"psr-4": { "Damax\\ChargeableApi\\Tests\\": "tests" }
},
"require": {
"php": "^7.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.10",
"friendsofphp/php-cs-fixer": "^2.14",
"matthiasnoback/symfony-dependency-injection-test": "^3.0",
"mongodb/mongodb": "^1.4",
"php-coveralls/php-coveralls": "^2.1",
Expand All @@ -22,12 +16,16 @@
"symfony/phpunit-bridge": "^4.0",
"symfony/security-bundle": "^4.1"
},
"autoload": {
"psr-4": { "Damax\\ChargeableApi\\": "src" }
},
"autoload-dev": {
"psr-4": { "Damax\\ChargeableApi\\Tests\\": "tests" }
},
"scripts": {
"cs": "php-cs-fixer fix",
"test": "simple-phpunit",
"test-cc": "./bin/phpunit-coverage",
"test-ci": "simple-phpunit --coverage-clover=build/logs/clover.xml",
"test-publish": "php-coveralls"
"test-cc": "phpdbg -qrr ./vendor/bin/simple-phpunit --coverage-html=build/phpunit"
},
"config": {
"sort-packages": true
Expand Down
26 changes: 0 additions & 26 deletions doc/development.md

This file was deleted.

4 changes: 0 additions & 4 deletions doc/usage.md
Expand Up @@ -111,7 +111,3 @@ Register listener in container:
<tag name="kernel.event_subscriber" />
</service>
```

## Next

If you wish to contribute take a look how to [run the code locally](development.md) in Docker.
18 changes: 18 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,18 @@
version: '3.5'
services:

composer:
image: prooph/composer:7.2
volumes:
- ".:/app"
working_dir: /app
environment:
MONGO_HOST: mongo
SYMFONY_PHPUNIT_VERSION: 7.4

mongo:
image: mongo:4.0
command: --smallfiles

dockerize:
image: jwilder/dockerize
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Expand Up @@ -12,7 +12,7 @@
</php>

<testsuites>
<testsuite name="Damax chargeable API suite">
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
Expand Up @@ -21,9 +21,9 @@ final class Configuration implements ConfigurationInterface

public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$treeBuilder = new TreeBuilder('damax_chargeable_api');

$rootNode = $treeBuilder->root('damax_chargeable_api');
$rootNode = $treeBuilder->getRootNode();
$rootNode
->children()
->append($this->walletNode('wallet'))
Expand Down
4 changes: 2 additions & 2 deletions tests/Wallet/MongoWalletTest.php
Expand Up @@ -26,8 +26,8 @@ class MongoWalletTest extends TestCase

public static function setUpBeforeClass()
{
$host = $_ENV['MONGO_PORT_27017_TCP_ADDR'] ?? 'localhost';
$port = $_ENV['MONGO_PORT_27017_TCP_PORT'] ?? 27017;
$host = $_ENV['MONGO_HOST'] ?? 'localhost';
$port = $_ENV['MONGO_PORT'] ?? 27017;

self::$collection = (new Client(sprintf('mongodb://%s:%d', $host, $port)))->selectCollection('api_test', 'wallet');
}
Expand Down

0 comments on commit 1e1b39f

Please sign in to comment.