Skip to content

Commit

Permalink
Merge remote branch 'pborreli/windows-fix-test'
Browse files Browse the repository at this point in the history
* pborreli/windows-fix-test:
  [Sismo][Windows] Fixed tests
  [Sismo] Better exception for failing Process
  • Loading branch information
fabpot committed Apr 12, 2011
2 parents 7595237 + e9af0ea commit 0416b0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Sismo/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,14 @@ private function createCommit($project, $result)

return $commit;
}

public function close()
{
$this->db->close();
}

public function __destruct()
{
$this->close();
}
}
4 changes: 3 additions & 1 deletion tests/appTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function createApp()
{
$app = require __DIR__.'/../src/bootstrap.php';

$this->baseDir = sys_get_temp_dir().'/sismo';
$this->baseDir = realpath(sys_get_temp_dir()).'/sismo';
$fs = new Filesystem();
$fs->mkdir($this->baseDir);
$fs->mkdir($this->baseDir.'/config');
Expand All @@ -40,6 +40,8 @@ public function tearDown()
{
parent::tearDown();

$this->app['storage']->close();

$fs = new Filesystem();
$fs->remove($this->baseDir);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function tearDown()
{
parent::tearDown();

$this->app['storage']->close();

$fs = new Filesystem();
$fs->remove($this->baseDir);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/consoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testBuildForProjects()
$tester = new ApplicationTester($this->console);

$this->assertEquals(0, $tester->run(array('command' => 'build')));
$this->assertEquals("Building Project \"Twig\" (into \"d41d8c\")\n\nBuilding Project \"Silex\" (into \"d41d8c\")", trim($tester->getDisplay()));
$this->assertEquals('Building Project "Twig" (into "d41d8c")'.PHP_EOL.PHP_EOL.'Building Project "Silex" (into "d41d8c")', trim($tester->getDisplay()));
}

public function testVerboseBuildForProject()
Expand Down

0 comments on commit 0416b0f

Please sign in to comment.