From 6fd5c5dc1064e49705383b4dc3093f440aab4413 Mon Sep 17 00:00:00 2001 From: camer0n Date: Fri, 10 May 2024 11:42:52 -0700 Subject: [PATCH] Minor tweaks and extended File zip test. --- e107_tests/tests/unit/e_fileTest.php | 14 ++++++++++---- e107_themes/bootstrap5/theme.php | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/e107_tests/tests/unit/e_fileTest.php b/e107_tests/tests/unit/e_fileTest.php index fe96cd763..c3a980bf8 100644 --- a/e107_tests/tests/unit/e_fileTest.php +++ b/e107_tests/tests/unit/e_fileTest.php @@ -303,13 +303,19 @@ class e_fileTest extends \Codeception\Test\Unit $contents = self::readZipFile($destinationPath); self::assertSame($expected, $contents); + + // Test directory path. + $destinationPath = e_TEMP."testZip2.zip"; + + $data = array(); + $data[] = e_TEMP; + $result = $this->fl->zip($data , $destinationPath, ['remove_path'=>e_IMAGE]); + $contents = self::readZipFile($destinationPath); + self::assertNotEmpty($contents); + } /* - public function testZip() - { - - } public function testSetDefaults() { diff --git a/e107_themes/bootstrap5/theme.php b/e107_themes/bootstrap5/theme.php index 661c4054b..497e3890f 100644 --- a/e107_themes/bootstrap5/theme.php +++ b/e107_themes/bootstrap5/theme.php @@ -57,10 +57,10 @@ if(!defined('e107_INIT')) } - function tablestyle($caption, $text, $mode='', $options = array()) + function tablestyle($caption, $text, $mode='', $data = array()) { - $style = varset($options['setStyle'], 'default'); + $style = varset($data['setStyle'], 'default'); // Override style based on mode. switch($mode) @@ -82,15 +82,15 @@ if(!defined('e107_INIT')) break; } - echo "\n\n\n"; + echo "\n\n\n"; - if($style === 'listgroup' && empty($options['list'])) + if($style === 'listgroup' && empty($data['list'])) { $style = 'cardmenu'; } - if($style === 'cardmenu' && !empty($options['list'])) + if($style === 'cardmenu' && !empty($data['list'])) { $style = 'listgroup'; } @@ -106,7 +106,7 @@ if(!defined('e107_INIT')) if(deftrue('e_DEBUG')) { echo "\n\n\n"; } @@ -167,10 +167,10 @@ if(!defined('e107_INIT')) } echo $text; - if(!empty($options['footer'])) // XXX @see news-months menu. + if(!empty($data['footer'])) // XXX @see news-months menu. { echo ''; } @@ -190,10 +190,10 @@ if(!defined('e107_INIT')) echo $text; - if(!empty($options['footer'])) // XXX @see news-months menu. + if(!empty($data['footer'])) // XXX @see news-months menu. { echo ''; }