2026-03-29 22:59:17 +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-03-29 22:59:17 +00:00
|
|
|
use App\Models\Workspace;
|
|
|
|
|
|
|
|
|
|
function createWorkspaceApiToken(array $overrides = []): array
|
|
|
|
|
{
|
2026-05-03 21:38:17 +00:00
|
|
|
return createApiTestToken($overrides);
|
2026-03-29 22:59:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test('show current workspace', function () {
|
|
|
|
|
$workspace = Workspace::factory()->create([
|
|
|
|
|
'name' => 'Test Workspace',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$result = createWorkspaceApiToken(['workspace' => $workspace]);
|
|
|
|
|
|
|
|
|
|
$response = $this->withHeaders([
|
|
|
|
|
'Authorization' => 'Bearer '.$result['plain_token'],
|
|
|
|
|
])->getJson(
|
|
|
|
|
route('api.workspace.show'),
|
|
|
|
|
['HTTP_HOST' => 'api.trypost.test']
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$response->assertOk();
|
|
|
|
|
$response->assertJsonPath('name', 'Test Workspace');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('show workspace requires authentication', function () {
|
|
|
|
|
$response = $this->getJson(
|
|
|
|
|
route('api.workspace.show'),
|
|
|
|
|
['HTTP_HOST' => 'api.trypost.test']
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$response->assertUnauthorized();
|
|
|
|
|
});
|
feat: social account toggle action, API, MCP + full test coverage
- Extract ToggleSocialAccount action from SocialController
- Add API endpoints: GET /social-accounts, PUT /social-accounts/{id}/toggle
- Add MCP tools: ListSocialAccountsTool, ToggleSocialAccountTool
- Fix all MCP tools: findOrFail → find + Response::error for graceful errors
- Fix MCP tools using $request->validated() without validate() call
- Fix return types to Response|ResponseFactory for error paths
- Add SocialAccountResource is_active/status fields (no tokens exposed)
- Add 43 MCP tests covering all 18 tools (CRUD, validation, cross-workspace)
- Add API response structure tests for posts, hashtags, labels, workspace
- Add API validation tests for post create/update, api-key expiry, label color
- Add API cross-workspace delete tests for hashtags and labels
- Add app validation tests for hashtag/label update, invite fields, password
- Add auth required tests for notifications, profile delete, api-keys index
- Add media reorder validation tests
2026-03-31 04:42:39 +00:00
|
|
|
|
|
|
|
|
test('workspace returns correct structure', function () {
|
|
|
|
|
$result = createWorkspaceApiToken();
|
|
|
|
|
|
|
|
|
|
$this->withHeaders(['Authorization' => 'Bearer '.data_get($result, 'plain_token')])
|
|
|
|
|
->getJson(route('api.workspace.show'))
|
|
|
|
|
->assertOk()
|
2026-04-17 02:05:51 +00:00
|
|
|
->assertJsonStructure(['id', 'name', 'created_at', 'updated_at']);
|
feat: social account toggle action, API, MCP + full test coverage
- Extract ToggleSocialAccount action from SocialController
- Add API endpoints: GET /social-accounts, PUT /social-accounts/{id}/toggle
- Add MCP tools: ListSocialAccountsTool, ToggleSocialAccountTool
- Fix all MCP tools: findOrFail → find + Response::error for graceful errors
- Fix MCP tools using $request->validated() without validate() call
- Fix return types to Response|ResponseFactory for error paths
- Add SocialAccountResource is_active/status fields (no tokens exposed)
- Add 43 MCP tests covering all 18 tools (CRUD, validation, cross-workspace)
- Add API response structure tests for posts, hashtags, labels, workspace
- Add API validation tests for post create/update, api-key expiry, label color
- Add API cross-workspace delete tests for hashtags and labels
- Add app validation tests for hashtag/label update, invite fields, password
- Add auth required tests for notifications, profile delete, api-keys index
- Add media reorder validation tests
2026-03-31 04:42:39 +00:00
|
|
|
});
|