Add basic unit testing. re #96
This commit is contained in:
parent
e3bf13ab47
commit
c994cf789f
4 changed files with 30 additions and 0 deletions
14
test/baseTest.php
Normal file
14
test/baseTest.php
Normal file
|
@ -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
Normal file
4
test/config_test.php
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
$config = array();
|
||||
$config['default_timezone'] = "Europe/Paris";
|
Loading…
Add table
Add a link
Reference in a new issue