1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-29 01:00:20 +02:00

Code optimization for speed and reduced memory usage.

This commit is contained in:
Cameron
2020-12-20 11:50:10 -08:00
parent 6b5cc07929
commit 601df26d51
91 changed files with 522 additions and 482 deletions

View File

@@ -163,12 +163,14 @@ class e_fileTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_dirs()
{
$actual = $this->fl->get_dirs(e_LANGUAGEDIR);
$expected = array ( 0 => 'English' );
$this->assertSame($expected, $actual);
}
/*
public function testGetErrorMessage()
{
@@ -387,12 +389,26 @@ class e_fileTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_files()
{
$reject = array('style.*');
$result = $this->fl->get_files(e_THEME."voux/", "\.php|\.css|\.xml|preview\.jpg|preview\.png", $reject, 1);
$files = array();
foreach($result as $f)
{
$files[] = $f['fname'];
}
$this->assertContains('install.xml', $files); // 1 level deep.
$this->assertContains('theme.php', $files);
$this->assertContains('theme.xml', $files);
$this->assertNotContains('style.css', $files);
}
/*
public function testGetUserDir()
{

View File

@@ -744,12 +744,22 @@ class e_formTest extends \Codeception\Test\Unit
{
}
*/
public function testGet_attributes()
{
$options = array(
'class' => 'myclass',
'id' => 'custom-id',
'readonly' => true,
'data-something' => 'custom-att'
);
$actual = $this->_frm->get_attributes($options);
$expected = " class='myclass' id='custom-id' readonly='readonly' data-something='custom-att'";
$this->assertSame($expected, $actual);
}
/*
public function test_format_id()
{