First, Don't use relative path(s).
Check out these Questions, they're described nicely in terms of Paths.
Second, Don't use wp-blog-header.php
just like that. If you really want Wordpress Environment to work inside your test.php file, Then it'll be better if you either write code as a Plugin or write your code in function.php.
Reference Links
Third, wp-blog-header.php
should be called before any file you are requiring in your code. So that way Wordpress environment loads into that file as well. Otherwise, Wordpress functions will not work properly.
Check index.php
inside Wordpress root folder. wp-blog-header.php
is the first file required to load Wordpress Environment.
index.php (At Wordpress Root Folder)
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );