mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:50:11 +00:00
Throw Not Found exception when $uid doesn't exist in Factory\Api\Twitter\User->createFromUserId
- Contact::getPublicIdByUserId() wrongly returns 0 when $uid doesn't exist, which is an existing albeit invalid record.
This commit is contained in:
parent
ac087749e3
commit
d37699bc08
2 changed files with 13 additions and 9 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Test\src\Factory\Api\Twitter;
|
|||
|
||||
use Friendica\DI;
|
||||
use Friendica\Factory\Api\Twitter\User;
|
||||
use Friendica\Network\HTTPException\NotFoundException;
|
||||
use Friendica\Test\FixtureTest;
|
||||
use Friendica\Test\src\Module\Api\ApiTest;
|
||||
|
||||
|
@ -133,15 +134,11 @@ class UserTest extends FixtureTest
|
|||
*/
|
||||
public function testApiGetUserWithWrongGetId()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$user = (new User(DI::logger(), DI::twitterStatus()))
|
||||
->createFromUserId(-1)
|
||||
->toArray();
|
||||
|
||||
self::assertEquals(0, $user['id']);
|
||||
self::assertEquals(0, $user['uid']);
|
||||
self::assertEquals(0, $user['cid']);
|
||||
self::assertEquals(0, $user['pid']);
|
||||
self::assertEmpty($user['name']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue