-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathWorkspaceExportCommandTest.php
More file actions
46 lines (34 loc) · 1.15 KB
/
WorkspaceExportCommandTest.php
File metadata and controls
46 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
declare(strict_types=1);
namespace PHPCR\Tests\Util\Console\Command;
use PHPCR\RepositoryInterface;
use PHPCR\Util\Console\Command\WorkspaceExportCommand;
class WorkspaceExportCommandTest extends BaseCommandTest
{
public function setUp(): void
{
parent::setUp();
$this->application->add(new WorkspaceExportCommand());
}
public function tearDown(): void
{
unlink('test');
}
public function testNodeTypeList(): void
{
$this->session->expects($this->once())
->method('getRepository')
->willReturn($this->repository);
$this->repository->expects($this->once())
->method('getDescriptor')
->with(RepositoryInterface::OPTION_XML_EXPORT_SUPPORTED)
->willReturn(true);
$this->session->expects($this->once())
->method('exportSystemView');
$this->assertFileDoesNotExist('test', 'test export file must not exist, it will be overwritten');
$ct = $this->executeCommand('phpcr:workspace:export', [
'filename' => 'test',
]);
$this->assertEquals(0, $ct->getStatusCode());
}
}