I work with $permalogin=1. So the condition $permalogin>1 will result false as well as $permalogin<1. So it is not disabled if the other two conditions meet, what is absolutely correct.
But now let's assume $permalogin is forced to be always active (2). The condition $permalogin>1 will give "true" what means isPermaloginDisabled() will surely return true. That means permalogin is disabled, what is the opposite of "forced to be always active"!
Now let's assume the 2'nd and the 3'rd condition result in false. So all depends on the first condition $permalogin>1.
Here are the 4 cases:
isPermaloginDisabled()
$permalogin $permalogin>1 returns my comment
-1 false false should be true because -1 means disabled
0 false false should be true because 0 means disabled by default
1 false false THIS IS THE ONLY CORRECT RESULT
2 true true should be false because 2 means permalogin is forced to be enabled (not disabled)
So if you need a testcase, simply set permalogin to 2 and it will NOT be shown although it means to be forced to.
Let's modify the condition to $permalogin < 1:
protected function isPermaloginDisabled(int $permaLogin): bool
{
return $permaLogin < 1
|| (int)($this->settings['showPermaLogin'] ?? 0) === 0
|| $GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'] === 0;
}
This will result in the following cases:
isPermaloginDisabled()
$permalogin $permalogin<1 returns my comment
-1 true true correct
0 true true correct
1 false false correct
2 false false correct