Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHPUnit测试在写入文件时失败_Phpunit_Travis Ci - Fatal编程技术网

PHPUnit测试在写入文件时失败

PHPUnit测试在写入文件时失败,phpunit,travis-ci,Phpunit,Travis Ci,我的单元测试在Travis CI上失败,但在本地没有 错误消息: 1) testBackupPathTestCase::testMergeExistingPath RuntimeException: Error writing to file. (/tmp/wordpress/wp-content/backupwordpress- a74dcf0e84-backups/.schedule-test-merge-existing-path-running) 测试结果如下: 该异常由以下函

我的单元测试在Travis CI上失败,但在本地没有

错误消息:

1) testBackupPathTestCase::testMergeExistingPath
RuntimeException: Error writing to file. (/tmp/wordpress/wp-content/backupwordpress-   a74dcf0e84-backups/.schedule-test-merge-existing-path-running)
测试结果如下:

该异常由以下函数引发:

/**
 * Set the status of the running backup
 *
 * @access public
 *
 * @param string $message
 *
 * @return void
 */
public function set_status( $message ) {

    $status = json_encode( (object) array(
        'filename' => $this->get_archive_filename(),
        'started'  => $this->get_schedule_running_start_time(),
        'status'   => $message,
    ) );

    if ( false === @file_put_contents( $this->get_schedule_running_path(), $status ) ) {
        throw new RuntimeException( sprintf( __( 'Error writing to file. (%s)', 'backpwordpress' ), $this->get_schedule_running_path() ) );
    }

}
请参见此处的完整课程:


我如何确定这是由CI环境引起的错误,还是代码中的错误?

看起来您已经解决了它?如果你能自我回答,那就太好了。它自己修复了,不知道有多抱歉