-
-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic test to install and discover clients (#620)
* Add basic test to install and discover clients * Remove travis, use composer1
- Loading branch information
Showing
5 changed files
with
106 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- "*" | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
env: | ||
COMPOSER_NO_INTERACTION: 1 | ||
|
||
strategy: | ||
matrix: | ||
php: [7.4, 7.3, 7.2] | ||
dependency-version: [prefer-lowest, prefer-stable] | ||
|
||
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
tools: composer | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress | ||
- name: Execute Unit Tests | ||
run: composer test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false"> | ||
<testsuites> | ||
<testsuite name="Omnipay Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory>./src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Omnipay\Tests; | ||
|
||
use Omnipay\Common\Http\Client; | ||
use Omnipay\Omnipay; | ||
|
||
class OmnipayTest extends TestCase | ||
{ | ||
public function tearDown() | ||
{ | ||
Omnipay::setFactory(null); | ||
|
||
parent::tearDown(); | ||
} | ||
|
||
public function testGetFactory() | ||
{ | ||
Omnipay::setFactory(null); | ||
|
||
$factory = Omnipay::getFactory(); | ||
$this->assertInstanceOf('Omnipay\Common\GatewayFactory', $factory); | ||
} | ||
|
||
|
||
/** | ||
* Verify a new Client instance can be instantiated | ||
*/ | ||
public function testNewClient() | ||
{ | ||
$client = new Client(); | ||
|
||
$this->assertInstanceOf('Omnipay\Common\Http\Client', $client); | ||
} | ||
} |