Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workdir-independent tests #235

Merged
merged 2 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/composer.lock
/composer.phar
/tags
/vendor
Expand Down
4 changes: 2 additions & 2 deletions tests/Controller/RunTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testSymbol()

public function testCallgraph()
{
loadFixture($this->profiles, 'tests/fixtures/results.json');
loadFixture($this->profiles, XHGUI_ROOT_DIR . '/tests/fixtures/results.json');
Environment::mock(array(
'SCRIPT_NAME' => 'index.php',
'PATH_INFO' => '/',
Expand All @@ -154,7 +154,7 @@ public function testCallgraph()

public function testCallgraphData()
{
loadFixture($this->profiles, 'tests/fixtures/results.json');
loadFixture($this->profiles, XHGUI_ROOT_DIR . '/tests/fixtures/results.json');
Environment::mock(array(
'SCRIPT_NAME' => 'index.php',
'PATH_INFO' => '/',
Expand Down
2 changes: 1 addition & 1 deletion tests/ProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ProfileTest extends PHPUnit_Framework_TestCase
public function setUp()
{
parent::setUp();
$contents = file_get_contents('tests/fixtures/results.json');
$contents = file_get_contents(XHGUI_ROOT_DIR . '/tests/fixtures/results.json');
$this->_fixture = json_decode($contents, true);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ProfilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public function setUp()
{
$di = Xhgui_ServiceContainer::instance();
$this->profiles = $di['profiles'];
loadFixture($this->profiles, 'tests/fixtures/results.json');
loadFixture($this->profiles, XHGUI_ROOT_DIR . '/tests/fixtures/results.json');
}

public function testPagination()
Expand Down
8 changes: 4 additions & 4 deletions tests/Saver/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ class Saver_FileTest extends PHPUnit_Framework_TestCase
{
public function testSave()
{
$data = file_get_contents('tests/fixtures/results.json');
$data = file_get_contents(XHGUI_ROOT_DIR . '/tests/fixtures/results.json');

$file = tempnam(sys_get_temp_dir(), "xhgui");

$saver = new Xhgui_Saver_File($file);
$saver->save($data);

$this->assertEquals(json_encode($data).PHP_EOL, file_get_contents($file));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Saver/MongoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Saver_MongoTest extends PHPunit_Framework_TestCase
{
public function testSave()
{
$data = file_get_contents('tests/fixtures/results.json');
$data = file_get_contents(XHGUI_ROOT_DIR . '/tests/fixtures/results.json');

$profiles = $this->getMockBuilder('Xhgui_Profiles')
->disableOriginalConstructor()
Expand Down