fixed issues with empty (#26)

This commit is contained in:
Roland Gruber 2017-03-08 17:19:44 +01:00
parent bcfcd15e92
commit 036a16a031
3 changed files with 7 additions and 4 deletions

View File

@ -212,9 +212,10 @@ function printLabelValue(&$pdf, $valueEntry, $fontName) {
* @param string $fontName font name
*/
function printTable(&$pdf, $table, $fontName) {
if (!empty($table->getHeadline())) {
$headline = $table->getHeadline();
if (!empty($headline)) {
$pdf->SetFont($fontName, 'B', LAMPDF_FONT_SIZE);
$pdf->Cell(LAMPDF_LABELWIDTH, LAMPDF_LINEHEIGHT, $table->getHeadline() . ':', 0 , 0, 'L', 0);
$pdf->Cell(LAMPDF_LABELWIDTH, LAMPDF_LINEHEIGHT, $headline . ':', 0 , 0, 'L', 0);
$pdf->Ln(LAMPDF_LINEHEIGHT);
}
foreach ($table->rows as $row) {

View File

@ -66,7 +66,8 @@ catch (\Exception $e) {
die();
}
$twoFactorLabel = empty($config->getTwoFactorAuthenticationLabel()) ? _('PIN+Token') : $config->getTwoFactorAuthenticationLabel();
$twoFactorLabelConfig = $config->getTwoFactorAuthenticationLabel();
$twoFactorLabel = empty($twoFactorLabelConfig) ? _('PIN+Token') : $twoFactorLabelConfig;
if (sizeof($serials) == 0) {
if ($config->getTwoFactorAuthenticationOptional()) {

View File

@ -695,7 +695,8 @@ class LAMConfigTest extends PHPUnit_Framework_TestCase {
* Tests LAMConfig->getJobToken()
*/
public function testGetJobToken() {
$this->assertFalse(empty($this->lAMConfig->getJobToken()));
$token = $this->lAMConfig->getJobToken();
$this->assertFalse(empty($token));
}
/**