From a6058705a410b56fcc621e1fbfcbefe051d42881 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 5 May 2024 11:18:25 +0200 Subject: [PATCH] add test for new setting --- tst/ModelTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tst/ModelTest.php b/tst/ModelTest.php index de5d7118..39f4486e 100644 --- a/tst/ModelTest.php +++ b/tst/ModelTest.php @@ -452,6 +452,7 @@ class ModelTest extends TestCase public function testCommentWithDisabledVizhash() { $options = parse_ini_file(CONF, true); + $options['main']['discussiondatedisplay'] = 'false'; $options['main']['icon'] = 'none'; $options['model'] = array( 'class' => 'Database', @@ -493,6 +494,10 @@ class ModelTest extends TestCase $comment = current($this->_model->getPaste(Helper::getPasteId())->get()['comments']); $this->assertFalse(array_key_exists('icon', $comment['meta']), 'icon was not generated'); + $this->assertTrue(array_key_exists('created', $comment['meta']), 'creation is set, when using default configuration'); + + $comment = current($paste->get()['comments']); + $this->assertFalse(array_key_exists('created', $comment['meta']), 'creation is not set, if using disabled configuration'); } public function testCommentVizhash()