| Server IP : 62.173.141.34 / Your IP : 216.73.217.113 Web Server : Apache/2.4.63 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux server7.msonline.ru 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 User : izihss ( 1005) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/izihss/web/izihss.ru/public_html/wp-content/plugins/wp-filebase/tests/ |
Upload File : |
<?php
class CreateFileTest extends WP_UnitTestCase {
function test_new_file_remote() {
$usr = wp_create_user('test_admin', 'test_admin');
$this->assertNotWPError($usr);
wp_set_current_user($usr);
wpfb_loadclass('Admin');
$res = WPFB_Admin::InsertFile(array(
/* must be an image ! */
'file_remote_uri' => 'https://wpfilebase.com/wp-content/blogs.dir/2/files/2015/03/banner_023.png'
));
$this->assertEmpty($res['error'], $res['error']);
/** @var WPFB_File $file */
$file = $res['file'];
$this->assertTrue($file->IsLocal(),'IsLocal false');
$this->assertFileExists($file->GetLocalPath());
$this->assertNotEmpty($file->file_thumbnail);
$this->assertFileExists($file->GetThumbPath());
$this->assertTrue($file->Remove());
}
}