Skip to content

Commit

Permalink
PHP: Unit tests: init
Browse files Browse the repository at this point in the history
  • Loading branch information
kornrunner committed Mar 7, 2018
1 parent 274f92c commit c751da4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions php/test/ExchangeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

use ccxt\Exchange;
use PHPUnit\Framework\TestCase;

class ExchangeTest extends TestCase {

public function testSum () {
$this->assertSame (0, Exchange::sum ());
$this->assertSame (2, Exchange::sum (2));
$this->assertSame (432, Exchange::sum (2, 30, 400));
$this->assertSame (439, Exchange::sum (2, null, [88], 30, '7', 400, null));
}
}
3 changes: 3 additions & 0 deletions php/test/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="php/test/bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="false">

<testsuites>
<testsuite name="ccxt Test Suite">
<directory>php/test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">php</directory>
</whitelist>
</filter>

<php>
<ini name="memory_limit" value="-1" />
</php>
</phpunit>

0 comments on commit c751da4

Please sign in to comment.