1
0
Fork 0

Make API testable & move PhotoAlbum tests to new destination

This commit is contained in:
Philipp Holzer 2021-11-12 21:08:36 +01:00
commit e477cf215d
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
10 changed files with 174 additions and 96 deletions

View file

@ -0,0 +1,13 @@
<?php
namespace Friendica\Test\Util;
use Friendica\Security\Authentication;
class AuthenticationDouble extends Authentication
{
protected function setXAccMgmtStatusHeader(array $user_record)
{
// Don't set any header..
}
}

View file

@ -0,0 +1,21 @@
<?php
/**
* Name: TEST-ADDON: Authentication "allow all"
* Description: For testing purpose only
* Version: 1.0
* Author: Philipp Holzer <admin@philipp.info>
*/
use Friendica\Core\Hook;
use Friendica\Model\User;
function authtest_install()
{
Hook::register('authenticate', 'tests/Util/authtest/authtest.php', 'authtest_authenticate');
}
function authtest_authenticate($a,&$b)
{
$b['authenticated'] = 1;
$b['user_record'] = User::getById(42);
}