Fix BaseApi and corresponding tests
This commit is contained in:
parent
4cc36c9b2c
commit
d576bb136b
3 changed files with 40 additions and 1 deletions
31
tests/Util/AppDouble.php
Normal file
31
tests/Util/AppDouble.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue