Skip to content

Commit d1cc867

Browse files
committed
Merge pull request #151 from phpcr/remove-file-after-test
cleanup after the test has run
2 parents 8b4a716 + 481abe5 commit d1cc867

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/PHPCR/Tests/Util/Console/Command/WorkspaceExportCommandTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public function setUp()
1414
$this->application->add(new WorkspaceExportCommand());
1515
}
1616

17+
public function tearDown()
18+
{
19+
unlink('test');
20+
}
21+
1722
public function testNodeTypeList()
1823
{
1924
$this->session->expects($this->once())
@@ -26,8 +31,16 @@ public function testNodeTypeList()
2631
$this->session->expects($this->once())
2732
->method('exportSystemView');
2833

34+
$this->assertFileNotExists('test', 'test export file must not exist, it will be overwritten');
35+
2936
$ct = $this->executeCommand('phpcr:workspace:export', array(
3037
'filename' => 'test'
3138
));
39+
40+
if (method_exists($ct, 'getStatusCode')) {
41+
// only available since symfony 2.4
42+
$this->assertEquals(0, $ct->getStatusCode());
43+
}
44+
$this->assertFileExists('test');
3245
}
3346
}

0 commit comments

Comments
 (0)