Make API testable & move PhotoAlbum tests to new destination
This commit is contained in:
parent
a0c5c91886
commit
e477cf215d
10 changed files with 174 additions and 96 deletions
13
tests/Util/AuthenticationDouble.php
Normal file
13
tests/Util/AuthenticationDouble.php
Normal 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..
|
||||
}
|
||||
}
|
21
tests/Util/authtest/authtest.php
Normal file
21
tests/Util/authtest/authtest.php
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue