slight configuration changes, template modifications to make discussions
and password configurable, removed generated configuration test as it grows quite big and a new one can be generated easily if needed
This commit is contained in:
1
tst/.gitignore
vendored
Normal file
1
tst/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/configuration.php
|
||||
@@ -31,10 +31,12 @@ class RainTPLTest extends PHPUnit_Framework_TestCase
|
||||
$page->assign('ERROR', self::$error);
|
||||
$page->assign('STATUS', self::$status);
|
||||
$page->assign('VERSION', self::$version);
|
||||
$page->assign('BURNAFTERREADINGSELECTED', false);
|
||||
$page->assign('OPENDISCUSSION', false);
|
||||
$page->assign('DISCUSSION', true);
|
||||
$page->assign('OPENDISCUSSION', true);
|
||||
$page->assign('SYNTAXHIGHLIGHTING', true);
|
||||
$page->assign('SYNTAXHIGHLIGHTINGTHEME', 'sons-of-obsidian');
|
||||
$page->assign('BURNAFTERREADINGSELECTED', false);
|
||||
$page->assign('PASSWORD', true);
|
||||
$page->assign('BASE64JSVERSION', '2.1.9');
|
||||
$page->assign('NOTICE', 'example');
|
||||
$page->assign('EXPIRE', self::$expire);
|
||||
@@ -72,15 +74,29 @@ class RainTPLTest extends PHPUnit_Framework_TestCase
|
||||
$this->_content,
|
||||
'outputs error correctly'
|
||||
);
|
||||
$this->assertTag(
|
||||
array(
|
||||
'id' => 'password',
|
||||
),
|
||||
$this->_content,
|
||||
'password available if configured'
|
||||
);
|
||||
$this->assertTag(
|
||||
array(
|
||||
'id' => 'opendiscussion',
|
||||
'attributes' => array(
|
||||
'disabled' => 'disabled'
|
||||
'checked' => 'checked'
|
||||
),
|
||||
),
|
||||
$this->_content,
|
||||
'disables discussions if configured'
|
||||
'checked discussion if configured'
|
||||
);
|
||||
$this->assertTag(
|
||||
array(
|
||||
'id' => 'opendisc',
|
||||
),
|
||||
$this->_content,
|
||||
'discussions available if configured'
|
||||
);
|
||||
// testing version number in JS address, since other instances may not be present in different templates
|
||||
$this->assertTag(
|
||||
|
||||
@@ -16,19 +16,16 @@ $vrd = array('view', 'read', 'delete');
|
||||
$vcud = array('view', 'create', 'read', 'delete');
|
||||
|
||||
new configurationTestGenerator(array(
|
||||
'main/opendiscussion' => array(
|
||||
'main/discussion' => array(
|
||||
array(
|
||||
'setting' => true,
|
||||
'tests' => array(
|
||||
array(
|
||||
'conditions' => array('steps' => $vrd),
|
||||
'type' => 'NotTag',
|
||||
'type' => 'Tag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'opendiscussion',
|
||||
'attributes' => array(
|
||||
'disabled' => 'disabled',
|
||||
),
|
||||
'id' => 'opendisc',
|
||||
),
|
||||
'$content',
|
||||
'outputs enabled discussion correctly'
|
||||
@@ -57,16 +54,54 @@ new configurationTestGenerator(array(
|
||||
'setting' => false,
|
||||
'tests' => array(
|
||||
array(
|
||||
'type' => 'NotTag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'opendisc',
|
||||
),
|
||||
'$content',
|
||||
'outputs disabled discussion correctly'
|
||||
),
|
||||
),
|
||||
),
|
||||
'affects' => $vrd
|
||||
),
|
||||
),
|
||||
'main/opendiscussion' => array(
|
||||
array(
|
||||
'setting' => true,
|
||||
'tests' => array(
|
||||
array(
|
||||
'conditions' => array('main/discussion' => true),
|
||||
'type' => 'Tag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'opendiscussion',
|
||||
'attributes' => array(
|
||||
'disabled' => 'disabled',
|
||||
'checked' => 'checked',
|
||||
),
|
||||
),
|
||||
'$content',
|
||||
'outputs disabled discussion correctly'
|
||||
'outputs checked discussion correctly'
|
||||
),
|
||||
),
|
||||
),
|
||||
'affects' => $vrd
|
||||
), array(
|
||||
'setting' => false,
|
||||
'tests' => array(
|
||||
array(
|
||||
'conditions' => array('main/discussion' => true),
|
||||
'type' => 'NotTag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'opendiscussion',
|
||||
'attributes' => array(
|
||||
'checked' => 'checked',
|
||||
),
|
||||
),
|
||||
'$content',
|
||||
'outputs unchecked discussion correctly'
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -240,6 +275,40 @@ new configurationTestGenerator(array(
|
||||
'affects' => array('view'),
|
||||
),
|
||||
),
|
||||
'main/password' => array(
|
||||
array(
|
||||
'setting' => true,
|
||||
'tests' => array(
|
||||
array(
|
||||
'type' => 'Tag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'password',
|
||||
),
|
||||
'$content',
|
||||
'outputs password input correctly'
|
||||
),
|
||||
),
|
||||
),
|
||||
'affects' => $vrd
|
||||
), array(
|
||||
'setting' => false,
|
||||
'tests' => array(
|
||||
array(
|
||||
'conditions' => array('main/discussion' => true),
|
||||
'type' => 'NotTag',
|
||||
'args' => array(
|
||||
array(
|
||||
'id' => 'password',
|
||||
),
|
||||
'$content',
|
||||
'removes password input correctly'
|
||||
),
|
||||
),
|
||||
),
|
||||
'affects' => $vrd
|
||||
),
|
||||
),
|
||||
'main/template' => array(
|
||||
array(
|
||||
'setting' => 'page',
|
||||
@@ -421,7 +490,7 @@ class configurationTestGenerator
|
||||
* creating factorial configurations
|
||||
* @var int
|
||||
*/
|
||||
const MAX_ITERATIONS = 1000;
|
||||
const MAX_ITERATIONS = 2000;
|
||||
|
||||
/**
|
||||
* options to test
|
||||
|
||||
17345
tst/configuration.php
17345
tst/configuration.php
File diff suppressed because it is too large
Load Diff
49
tst/test.ini
Normal file
49
tst/test.ini
Normal file
@@ -0,0 +1,49 @@
|
||||
[main]
|
||||
discussion = true
|
||||
opendiscussion = true
|
||||
syntaxhighlighting = true
|
||||
burnafterreadingselected = true
|
||||
password = true
|
||||
sizelimit = 10
|
||||
template = "page"
|
||||
base64version = "2.1.9"
|
||||
syntaxhighlightingtheme = "sons-of-obsidian"
|
||||
|
||||
[expire]
|
||||
default = "1week"
|
||||
|
||||
[expire_options]
|
||||
5min = "300"
|
||||
10min = "600"
|
||||
1hour = "3600"
|
||||
1day = "86400"
|
||||
1week = "604800"
|
||||
1month = "2592000"
|
||||
1year = "31536000"
|
||||
never = "0"
|
||||
|
||||
[expire_labels]
|
||||
5min = "5 minutes"
|
||||
10min = "10 minutes"
|
||||
1hour = "1 hour"
|
||||
1day = "1 day"
|
||||
1week = "1 week"
|
||||
1month = "1 month"
|
||||
1year = "1 year"
|
||||
never = "Never"
|
||||
|
||||
[traffic]
|
||||
limit = 0
|
||||
dir = "../data"
|
||||
|
||||
[model]
|
||||
class = "zerobin_db"
|
||||
|
||||
[model_options]
|
||||
dsn = "sqlite:../data/db.sq3"
|
||||
usr = ""
|
||||
pwd = ""
|
||||
opt = array (
|
||||
12 => '1',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user