进行了一些小修复
This commit is contained in:
1 parent
af3539914d
commit
fff1590a43
5 files changed
+61
-15
No files matched your search
@@ -16,6 +16,22 @@ test('front submit enqueues the WordPress editor before wp_head is rendered', ()
|
||||
assert.ok(enqueueAt < headerAt, 'editor assets must be queued before get_header()/wp_head');
|
||||
});
|
||||
|
||||
test('front submit uploads use the effective WordPress server limit', () => {
|
||||
const controller = read('src/Core/FrontSubmit.php');
|
||||
const page = read('templates/pages/page-submit.php');
|
||||
|
||||
assert.match(controller, /function upload_limit_bytes\(string \$kind\): int/);
|
||||
assert.match(controller, /min\(\$configured_mb \* MB_IN_BYTES, \(int\) wp_max_upload_size\(\)\)/);
|
||||
assert.match(controller, /UPLOAD_ERR_INI_SIZE/);
|
||||
assert.match(controller, /UPLOAD_ERR_FORM_SIZE/);
|
||||
assert.match(controller, /UPLOAD_ERR_PARTIAL/);
|
||||
assert.match(controller, /\['status' => 413\]/);
|
||||
assert.match(page, /FrontSubmit::upload_limit_bytes\('image'\)/);
|
||||
assert.match(page, /FrontSubmit::upload_limit_bytes\('video'\)/);
|
||||
assert.match(page, /FrontSubmit::upload_limit_bytes\('resource'\)/);
|
||||
assert.doesNotMatch(page, /\$attachment_settings\s*=/);
|
||||
});
|
||||
|
||||
test('published post content reaches the front submit editor unchanged', () => {
|
||||
const context = read('templates/parts/submit/context.php');
|
||||
const editor = read('templates/parts/submit/editor-main.php');
|
||||
|
||||
Reference in new issue
Block a user