Add basic unit testing. re #96
Цей коміт міститься в:
джерело
e3bf13ab47
коміт
c994cf789f
4 змінених файлів з 30 додано та 0 видалено
5
.travis.yml
Звичайний файл
5
.travis.yml
Звичайний файл
|
|
@ -0,0 +1,5 @@
|
|||
language: php
|
||||
php:
|
||||
- 5.5
|
||||
- 5.4
|
||||
- 5.3
|
||||
7
phpunit.xml
Звичайний файл
7
phpunit.xml
Звичайний файл
|
|
@ -0,0 +1,7 @@
|
|||
<phpunit>
|
||||
<testsuites>
|
||||
<testsuite name="COPS">
|
||||
<directory>test</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
14
test/baseTest.php
Звичайний файл
14
test/baseTest.php
Звичайний файл
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
require_once (dirname(__FILE__) . "/config_test.php");
|
||||
require_once (dirname(__FILE__) . "/../base.php");
|
||||
|
||||
class StackTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testAddURLParameter ()
|
||||
{
|
||||
$this->assertEquals ("?db=0", addURLParameter ("?", "db", "0"));
|
||||
$this->assertEquals ("?key=value&db=0", addURLParameter ("?key=value", "db", "0"));
|
||||
$this->assertEquals ("?key=value&otherKey=&db=0", addURLParameter ("?key=value&otherKey", "db", "0"));
|
||||
}
|
||||
}
|
||||
4
test/config_test.php
Звичайний файл
4
test/config_test.php
Звичайний файл
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
$config = array();
|
||||
$config['default_timezone'] = "Europe/Paris";
|
||||
Завантаження…
Додати таблицю
Додати посилання
Послатися в новій задачі