StorageInterface::url 의 public 하드코딩을 완화하고 core.storage.filter_url 훅을 신설해, 완전 공개 자산(상품·카테고리·리뷰·에디터 이미지)의 직접 URL 서빙을 옵트인으로 열었다. 미설정 시 기존 스트리밍 100% 보존. 디스크 결정은 확장 개별 설정 > 코어 전역 > 미설정 순이며, 서빙·삭제·이동은 행에 기록된 disk 를 따라 전환 전후 자산이 혼재해도 각자 실제 저장 위치를 향한다. 고아 disk(공급 플러그인 비활성화)는 스트리밍으로 폴백해 500 이 되지 않는다. 공개 이슈 (@lyg-kaban 건의) 대응.
34 lines
910 B
PHP
34 lines
910 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Models;
|
|
|
|
use App\Models\Attachment;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* 코어 Attachment URL 조립 단일 지점(urlForHash/download_url) 회귀 테스트
|
|
*
|
|
* URL 중복 조립 정리(#100) 후에도 응답 문자열이 기존과 동일함을 고정합니다.
|
|
*/
|
|
class AttachmentUrlTest extends TestCase
|
|
{
|
|
/**
|
|
* @effects board_response_strings_unchanged
|
|
*/
|
|
#[Test]
|
|
public function url_for_hash_builds_core_attachment_url(): void
|
|
{
|
|
$this->assertSame('/api/attachment/abc123def456', Attachment::urlForHash('abc123def456'));
|
|
}
|
|
|
|
#[Test]
|
|
public function download_url_accessor_delegates_to_url_for_hash(): void
|
|
{
|
|
$attachment = new Attachment;
|
|
$attachment->hash = 'abc123def456';
|
|
|
|
$this->assertSame('/api/attachment/abc123def456', $attachment->download_url);
|
|
}
|
|
}
|