Fix BaseApi and corresponding tests

This commit is contained in:
Philipp Holzer 2021-11-28 13:11:12 +01:00
commit d576bb136b
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
3 changed files with 40 additions and 1 deletions

31
tests/Util/AppDouble.php Normal file
View file

@ -0,0 +1,31 @@
<?php
namespace Friendica\Test\Util;
use Friendica\App;
/**
* Making the App class overridable for specific situations
*
* @see App
*/
class AppDouble extends App
{
/** @var bool Marks/Overwrites if the user is currently logged in */
protected $isLoggedIn = false;
/**
* Manually overwrite the "isLoggedIn" behavior
*
* @param bool $isLoggedIn
*/
public function setIsLoggedIn(bool $isLoggedIn)
{
$this->isLoggedIn = $isLoggedIn;
}
public function isLoggedIn()
{
return $this->isLoggedIn;
}
}