1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 17:44:37 +02:00

Fixes #5092 - Removed example code with error and added new example. Minor cleanup of class.

This commit is contained in:
camer0n
2023-10-31 12:34:28 -07:00
parent 187d45dcd8
commit fb98771b82
2 changed files with 68 additions and 15 deletions

View File

@@ -347,7 +347,27 @@ class e_pluginbuilderTest extends \Codeception\Test\Unit
$result = $this->pb->buildAdminUI($this->posted, 'pluginfolder', 'PluginTitle');
$expected = "'example_id' => array ( 'title' => LAN_ID, 'type' => 'number', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => [], 'writeParms' => [], 'class' => 'left', 'thclass' => 'left',)";
$this->assertStringContainsString($expected, $result);
// file_put_contents(__DIR__."/testBuild.php", "<?php\n\n".$result);
}
/* public function isValidCode($code)
{
$temp_file = tempnam(sys_get_temp_dir(), 'PHP');
file_put_contents($temp_file, $code);
$output = shell_exec("php -l $temp_file");
unlink($temp_file);
if (strpos($output, 'No syntax errors detected') === false)
{
return $output;
$this->fail("The code is not valid. Error message: $output");
}
return true;
}*/
/*
public function testRun()
{