Skip to content

Commit

Permalink
added build tests (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob committed Nov 29, 2016
1 parent 8f7395f commit 99a5bc1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .travis.yml
@@ -0,0 +1,8 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
2 changes: 2 additions & 0 deletions build/logs/junit-unittests.xml
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites/>
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -21,7 +21,8 @@
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^3.7 || ^4.8 || ^5.4"
"phpunit/phpunit": "^3.7 || ^4.8 || ^5.4",
"phpdocumentor/phpdocumentor": "2.*"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 15 additions & 0 deletions phpunit.xml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="./tests/init.php" colors="true">
<php>
<ini name="display_errors" value="stderr" />
<ini name="error_log" value="/dev/null" />
</php>
<testsuite name="Unit tests">
<directory>tests/</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
17 changes: 17 additions & 0 deletions tests/apiUnitTest.php
@@ -0,0 +1,17 @@
<?php
class apiUnitTest extends PHPUnit_Framework_TestCase {

protected function setUp() {
parent::setUp();
}

public function testCreateClientInstance() {
$oCardGate = new cardgate\api\Client( 1, 'fake_key', TRUE );
$oCardGate->setLanguage( 'nl' );
$oCardGate->version()->setPlatformName( 'PHP' );
$oCardGate->version()->setPlatformVersion( phpversion() );
$oCardGate->version()->setPluginName( 'Test Implementation' );
$oCardGate->version()->setPluginVersion( '0.0.1' );
}

}
4 changes: 4 additions & 0 deletions tests/init.php
@@ -0,0 +1,4 @@
<?php
require_once dirname( __FILE__ ) . '/../src/Autoloader.php';

cardgate\api\Autoloader::register();

0 comments on commit 99a5bc1

Please sign in to comment.