Skip to content

Commit c751da4

Browse files
committed
PHP: Unit tests: init
1 parent 274f92c commit c751da4

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

php/test/ExchangeTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use ccxt\Exchange;
4+
use PHPUnit\Framework\TestCase;
5+
6+
class ExchangeTest extends TestCase {
7+
8+
public function testSum () {
9+
$this->assertSame (0, Exchange::sum ());
10+
$this->assertSame (2, Exchange::sum (2));
11+
$this->assertSame (432, Exchange::sum (2, 30, 400));
12+
$this->assertSame (439, Exchange::sum (2, null, [88], 30, '7', 400, null));
13+
}
14+
}

php/test/bootstrap.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
require_once __DIR__ . '/../../vendor/autoload.php';

phpunit.xml.dist

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit bootstrap="php/test/bootstrap.php"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
6+
colors="true"
7+
verbose="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
processIsolation="true"
12+
stopOnFailure="false">
13+
14+
<testsuites>
15+
<testsuite name="ccxt Test Suite">
16+
<directory>php/test</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist>
22+
<directory suffix=".php">php</directory>
23+
</whitelist>
24+
</filter>
25+
26+
<php>
27+
<ini name="memory_limit" value="-1" />
28+
</php>
29+
</phpunit>

0 commit comments

Comments
 (0)