Skip to content

Commit

Permalink
Merge pull request #1 from Potelo/master
Browse files Browse the repository at this point in the history
update fork
  • Loading branch information
Guilherme-Franca-de-Souza committed Jan 9, 2024
2 parents ae906a9 + e7a8486 commit dae7183
Show file tree
Hide file tree
Showing 10 changed files with 451 additions and 343 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
phpunit-tests:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: docker build -t gu-payment .
- name: Execute tests via PHPUnit
env:
IUGU_ID: ${{ secrets.IUGU_ID }}
IUGU_APIKEY: ${{ secrets.IUGU_APIKEY }}
run: |
docker run \
--env IUGU_ID \
--env IUGU_APIKEY \
gu-payment
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ composer.lock
.DS_Store
.phpintel
.env
.idea
.idea
/.phpunit.result.cache
phpunit.xml
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM php:8.2-cli

RUN apt-get update && \
apt-get install -y \
git \
zip \
unzip \
libzip-dev && \
docker-php-ext-install zip

COPY --from=composer /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

COPY composer.json composer.json

RUN composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

COPY . /var/www/html

CMD ["composer", "test"]
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.4",
"iugu/iugu": "dev-master",
"dompdf/dompdf": "^0.8.0"
"dompdf/dompdf": "^2.0"
},
"require-dev": {
"mockery/mockery": "~1.0",
"orchestra/testbench": "~3.5",
"fzaninotto/faker": "^1.7",
"php-coveralls/php-coveralls": "^2.2"
"orchestra/testbench": "7.x"
},
"autoload": {
"psr-4": {
Expand All @@ -48,6 +45,12 @@
"kylekatarnls/update-helper": true
}
},
"scripts": {
"test": [
"Composer\\Config::disableProcessTimeout",
"phpunit"
]
},
"prefer-stable": true,
"minimum-stability": "dev"
}
28 changes: 0 additions & 28 deletions phpunit.xml

This file was deleted.

39 changes: 39 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./src/migrations</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz4Qp/A75G2RTiWVA/ZoKZvp6fiiM10="/>
<env name="IUGU_APIKEY" value=""/>
<env name="IUGU_ID" value=""/>
<env name="GUPAYMENT_SIGNATURE_TABLE" value="subscriptions"/>
<env name="IUGU_MODEL" value="\Potelo\GuPayment\Tests\Fixtures\User"/>
<env name="IUGU_MODEL_FOREIGN_KEY" value="user_id"/>
<env name="IUGU_USER_MODEL_COLUMN" value="iugu_id"/>
<env name="IUGU_SUBSCRIPTION_MODEL_ID_COLUMN" value="iugu_id"/>
<env name="IUGU_SUBSCRIPTION_MODEL_PLAN_COLUMN" value="iugu_plan"/>
</php>
</phpunit>
Loading

0 comments on commit dae7183

Please sign in to comment.