Add some rudimentary tests
This commit is contained in:
parent
d2234c0ad8
commit
4683025210
14
tests/ActionDateCTest.php
Normal file
14
tests/ActionDateCTest.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ActionDateCTest extends PHPUnit_Framework_TestCase {
|
||||||
|
function testDecode() {
|
||||||
|
$action = new ActionDateC("1374772515");
|
||||||
|
$expected = [1374772515 => '2013-07-25T17:15:15+00:00'];
|
||||||
|
$this->assertEquals($expected, $action->decode());
|
||||||
|
}
|
||||||
|
|
||||||
|
function testDecodeHasCorrectNumberOfResults() {
|
||||||
|
$action = new ActionDateC("1374772515\n1374772516");
|
||||||
|
$this->assertCount(2, $action->decode());
|
||||||
|
}
|
||||||
|
}
|
8
tests/ActionQuotedPrintableDecodeTest.php
Normal file
8
tests/ActionQuotedPrintableDecodeTest.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ActionQuotedPrintableDecodeTest extends PHPUnit_Framework_TestCase {
|
||||||
|
function testDecode() {
|
||||||
|
$action = new ActionQuotedPrintableDecode('a=3Db');
|
||||||
|
$this->assertEquals('a=b', $action->decode());
|
||||||
|
}
|
||||||
|
}
|
8
tests/ActionQuotedPrintableEncodeTest.php
Normal file
8
tests/ActionQuotedPrintableEncodeTest.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ActionQuotedPrintableEncodeTest extends PHPUnit_Framework_TestCase {
|
||||||
|
function testDecode() {
|
||||||
|
$action = new ActionQuotedPrintableEncode('a=b');
|
||||||
|
$this->assertEquals('a=3Db', $action->decode());
|
||||||
|
}
|
||||||
|
}
|
7
tests/bootstrap.php
Normal file
7
tests/bootstrap.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
require_once 'dBug.php';
|
||||||
|
require_once 'classes.php';
|
||||||
|
require_once 'functions.php';
|
Loading…
Reference in New Issue
Block a user