2026-01-18 18:56:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
refactor: settings redesign, Spanish translations, language system, strict_types
Settings pages:
- Redesign layout to match Sendkit (max-w-4xl, space-y-12, Separator sections)
- Merge Members page into Workspace settings with Table, invite Dialog, ConfirmDeleteModal
- Add workspace logo upload/delete routes and controller methods
- Translate all hardcoded strings in Workspace.vue modals
Language system:
- Drop languages table, replace language_id FK with locale string column on users
- Create config/languages.php for available languages and default locale
- Add Spanish (es) translations (13 files)
- Simplify HandleInertiaRequests, ProfileController, RegisteredUserController
Code quality:
- Add declare(strict_types=1) to all PHP files
- Fix MastodonPublisher using wrong attribute (filename -> original_filename)
- Fix HasMediaTest for new has_photo/photo_url accessors
- Fix PublishToSocialPlatformTest type error revealed by strict_types
- Remove orphaned Language model from AppServiceProvider morph map
- Update User TypeScript interface (has_photo, photo_url, locale)
- Eager load media relation on workspaces to prevent N+1
- Add 8 new tests for workspace logo upload/delete
- Update workspace settings test to assert members/invitations props
All 710 tests passing.
2026-03-30 03:20:43 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-18 18:56:51 +00:00
|
|
|
use App\Enums\PostPlatform\ContentType;
|
|
|
|
|
use App\Enums\SocialAccount\Platform;
|
|
|
|
|
use App\Exceptions\TokenExpiredException;
|
|
|
|
|
use App\Models\Post;
|
|
|
|
|
use App\Models\PostPlatform;
|
|
|
|
|
use App\Models\SocialAccount;
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Models\Workspace;
|
|
|
|
|
use App\Services\Social\ThreadsPublisher;
|
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
|
$this->user = User::factory()->create();
|
|
|
|
|
$this->workspace = Workspace::factory()->create(['user_id' => $this->user->id]);
|
|
|
|
|
|
|
|
|
|
$this->socialAccount = SocialAccount::factory()->threads()->create([
|
|
|
|
|
'workspace_id' => $this->workspace->id,
|
|
|
|
|
'platform_user_id' => '123456789',
|
|
|
|
|
'username' => 'testuser',
|
|
|
|
|
'token_expires_at' => now()->addDays(60),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->post = Post::factory()->create([
|
|
|
|
|
'workspace_id' => $this->workspace->id,
|
|
|
|
|
'user_id' => $this->user->id,
|
2026-04-15 23:11:36 +00:00
|
|
|
'content' => 'Hello from Threads!',
|
2026-01-18 18:56:51 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->postPlatform = PostPlatform::factory()->create([
|
|
|
|
|
'post_id' => $this->post->id,
|
|
|
|
|
'social_account_id' => $this->socialAccount->id,
|
|
|
|
|
'platform' => Platform::Threads,
|
|
|
|
|
'content_type' => ContentType::ThreadsPost,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->publisher = new ThreadsPublisher;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher can publish text-only post', function () {
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result)->toHaveKey('id');
|
|
|
|
|
expect($result)->toHaveKey('url');
|
|
|
|
|
expect($result['id'])->toBe('post-123456789');
|
|
|
|
|
expect($result['url'])->toBe('https://www.threads.net/@testuser/post/ABC123');
|
|
|
|
|
|
|
|
|
|
Http::assertSent(function ($request) {
|
|
|
|
|
return str_contains($request->url(), '/threads')
|
|
|
|
|
&& str_contains($request->url(), '123456789');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher can publish image post', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-id',
|
|
|
|
|
'path' => 'media/2026-01/test-image.jpg',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-image.jpg',
|
|
|
|
|
'mime_type' => 'image/jpeg',
|
|
|
|
|
'original_filename' => 'test.jpg',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-01-18 18:56:51 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'FINISHED',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('post-123456789');
|
|
|
|
|
|
|
|
|
|
Http::assertSent(function ($request) {
|
|
|
|
|
return str_contains($request->url(), '/threads');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher can publish video post', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-video',
|
|
|
|
|
'path' => 'media/2026-01/test-video.mp4',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-video.mp4',
|
|
|
|
|
'mime_type' => 'video/mp4',
|
|
|
|
|
'original_filename' => 'test.mp4',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-01-18 18:56:51 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'FINISHED',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('post-123456789');
|
|
|
|
|
|
|
|
|
|
Http::assertSent(function ($request) {
|
|
|
|
|
return str_contains($request->url(), '/threads');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher can publish carousel', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$mediaItems = [];
|
2026-01-18 18:56:51 +00:00
|
|
|
for ($i = 0; $i < 3; $i++) {
|
2026-04-15 23:11:36 +00:00
|
|
|
$mediaItems[] = [
|
|
|
|
|
'id' => "test-media-{$i}",
|
2026-01-18 18:56:51 +00:00
|
|
|
'path' => "media/2026-01/test-image-{$i}.jpg",
|
2026-04-15 23:11:36 +00:00
|
|
|
'url' => "https://example.com/media/2026-01/test-image-{$i}.jpg",
|
2026-01-18 18:56:51 +00:00
|
|
|
'mime_type' => 'image/jpeg',
|
2026-04-15 23:11:36 +00:00
|
|
|
'original_filename' => "test-{$i}.jpg",
|
|
|
|
|
];
|
2026-01-18 18:56:51 +00:00
|
|
|
}
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => $mediaItems]);
|
2026-01-18 18:56:51 +00:00
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'FINISHED',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('post-123456789');
|
|
|
|
|
|
|
|
|
|
Http::assertSent(function ($request) {
|
|
|
|
|
return str_contains($request->url(), '/threads');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher throws exception on api error', function () {
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'error' => [
|
|
|
|
|
'message' => 'Invalid parameter',
|
|
|
|
|
'type' => 'OAuthException',
|
|
|
|
|
'code' => 100,
|
|
|
|
|
],
|
|
|
|
|
], 400),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
|
|
|
|
->toThrow(Exception::class);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher throws token expired exception on auth error', function () {
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'error' => [
|
|
|
|
|
'message' => 'Error validating access token',
|
|
|
|
|
'type' => 'OAuthException',
|
|
|
|
|
'code' => 190,
|
|
|
|
|
],
|
|
|
|
|
], 401),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
|
|
|
|
->toThrow(TokenExpiredException::class);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher refreshes token when expired', function () {
|
|
|
|
|
$this->socialAccount->update(['token_expires_at' => now()->subHour()]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/refresh_access_token*' => Http::response([
|
|
|
|
|
'access_token' => 'new-long-lived-token',
|
|
|
|
|
'expires_in' => 5184000,
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
Http::assertSent(function ($request) {
|
|
|
|
|
return str_contains($request->url(), 'refresh_access_token');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$this->socialAccount->refresh();
|
|
|
|
|
expect($this->socialAccount->access_token)->toBe('new-long-lived-token');
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-12 21:56:52 +00:00
|
|
|
test('threads publisher throws TokenExpiredException when refresh_token is rejected', function () {
|
|
|
|
|
$this->socialAccount->update(['token_expires_at' => now()->subHour()]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/refresh_access_token*' => Http::response([
|
|
|
|
|
'error' => ['message' => 'Token is invalid', 'code' => 190],
|
|
|
|
|
], 400),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
|
|
|
|
->toThrow(TokenExpiredException::class, 'Token is invalid');
|
|
|
|
|
});
|
|
|
|
|
|
2026-01-18 18:56:51 +00:00
|
|
|
test('threads publisher waits for media processing', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-id',
|
|
|
|
|
'path' => 'media/2026-01/test-image.jpg',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-image.jpg',
|
|
|
|
|
'mime_type' => 'image/jpeg',
|
|
|
|
|
'original_filename' => 'test.jpg',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-01-18 18:56:51 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::sequence()
|
|
|
|
|
->push(['status' => 'IN_PROGRESS'], 200)
|
|
|
|
|
->push(['status' => 'IN_PROGRESS'], 200)
|
|
|
|
|
->push(['status' => 'FINISHED'], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'post-123456789',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/post-123456789*' => Http::response([
|
|
|
|
|
'permalink' => 'https://www.threads.net/@testuser/post/ABC123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('post-123456789');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher handles media processing error', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-id',
|
|
|
|
|
'path' => 'media/2026-01/test-image.jpg',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-image.jpg',
|
|
|
|
|
'mime_type' => 'image/jpeg',
|
|
|
|
|
'original_filename' => 'test.jpg',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-01-18 18:56:51 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'ERROR',
|
|
|
|
|
'error_message' => 'Media upload failed',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
|
|
|
|
->toThrow(Exception::class, 'Threads media processing failed');
|
|
|
|
|
});
|
2026-03-29 20:04:01 +00:00
|
|
|
|
|
|
|
|
test('threads publisher throws exception for text post with null content', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update(['content' => null]);
|
2026-03-29 20:04:01 +00:00
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
2026-03-29 22:24:28 +00:00
|
|
|
->toThrow(Exception::class, 'Threads text posts require content');
|
2026-03-29 20:04:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('threads publisher can publish image with null content', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'content' => null,
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-id',
|
|
|
|
|
'path' => 'media/2026-01/test-image.jpg',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-image.jpg',
|
|
|
|
|
'mime_type' => 'image/jpeg',
|
|
|
|
|
'original_filename' => 'test.jpg',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-03-29 20:04:01 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'FINISHED',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'media-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/media-123*' => Http::response([
|
|
|
|
|
'permalink' => 'https://threads.net/@testuser/post/123',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('media-123');
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-01 12:32:43 +00:00
|
|
|
test('threads publisher throws exception when all carousel items fail', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$mediaItems = [];
|
2026-04-01 12:32:43 +00:00
|
|
|
for ($i = 0; $i < 3; $i++) {
|
2026-04-15 23:11:36 +00:00
|
|
|
$mediaItems[] = [
|
|
|
|
|
'id' => "test-media-{$i}",
|
2026-04-01 12:32:43 +00:00
|
|
|
'path' => "media/2026-01/fail-image-{$i}.jpg",
|
2026-04-15 23:11:36 +00:00
|
|
|
'url' => "https://example.com/media/2026-01/fail-image-{$i}.jpg",
|
2026-04-01 12:32:43 +00:00
|
|
|
'mime_type' => 'image/jpeg',
|
2026-04-15 23:11:36 +00:00
|
|
|
'original_filename' => "fail-{$i}.jpg",
|
|
|
|
|
];
|
2026-04-01 12:32:43 +00:00
|
|
|
}
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'media' => $mediaItems]);
|
2026-04-01 12:32:43 +00:00
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'error' => [
|
|
|
|
|
'message' => 'Upload failed',
|
|
|
|
|
'type' => 'OAuthException',
|
|
|
|
|
'code' => 100,
|
|
|
|
|
],
|
|
|
|
|
], 400),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
expect(fn () => $this->publisher->publish($this->postPlatform))
|
|
|
|
|
->toThrow(Exception::class, 'Failed to create any carousel items');
|
|
|
|
|
});
|
|
|
|
|
|
2026-03-29 20:04:01 +00:00
|
|
|
test('threads publisher can publish video with null content', function () {
|
2026-04-15 23:11:36 +00:00
|
|
|
$this->post->update([
|
|
|
|
|
'content' => null,
|
|
|
|
|
'media' => [
|
|
|
|
|
[
|
|
|
|
|
'id' => 'test-media-video',
|
|
|
|
|
'path' => 'media/2026-01/test-video.mp4',
|
|
|
|
|
'url' => 'https://example.com/media/2026-01/test-video.mp4',
|
|
|
|
|
'mime_type' => 'video/mp4',
|
|
|
|
|
'original_filename' => 'test.mp4',
|
|
|
|
|
],
|
|
|
|
|
],
|
2026-03-29 20:04:01 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
Http::fake([
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads' => Http::response([
|
|
|
|
|
'id' => 'container-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/container-123*' => Http::response([
|
|
|
|
|
'status' => 'FINISHED',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/123456789/threads_publish' => Http::response([
|
|
|
|
|
'id' => 'video-123',
|
|
|
|
|
], 200),
|
|
|
|
|
'https://graph.threads.net/v1.0/video-123*' => Http::response([
|
|
|
|
|
'permalink' => 'https://threads.net/@testuser/post/456',
|
|
|
|
|
], 200),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = $this->publisher->publish($this->postPlatform);
|
|
|
|
|
|
|
|
|
|
expect($result['id'])->toBe('video-123');
|
|
|
|
|
});
|