Skip to content

Commit 4167ace

Browse files
committed
Fixed unit tests
1 parent 06a8450 commit 4167ace

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/PHPCR/Shell/Console/Application/ShellApplication.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ public function init()
142142
$this->transports[$transport->getName()] = $transport;;
143143
}
144144

145-
$session = $this->getSession($this->sessionInput);
145+
$session = $this->initSession();
146146

147-
$this->getHelperSet()->set(new EditorHelper($session));
147+
$this->getHelperSet()->set(new EditorHelper($this->session));
148148
$this->getHelperSet()->set(new PhpcrConsoleDumperHelper());
149-
$this->getHelperSet()->set(new PhpcrHelper($session));
149+
$this->getHelperSet()->set(new PhpcrHelper($this->session));
150150
$this->getHelperSet()->set(new ResultFormatterHelper());
151151
$this->getHelperSet()->set(new TextHelper());
152-
$this->getHelperSet()->set(new NodeHelper($session));
153-
$this->getHelperSet()->set(new RepositoryHelper($session->getRepository()));
152+
$this->getHelperSet()->set(new NodeHelper($this->session));
153+
$this->getHelperSet()->set(new RepositoryHelper($this->session->getRepository()));
154154

155155
// add new commands
156156
$this->add(new AccessControlPrivilegeListCommand());

tests/PHPCR/Shell/Application/ShellApplicationTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ public function setUp()
1212
$this->transport = $this->getMock(
1313
'PHPCR\Shell\Console\TransportInterface'
1414
);
15-
$this->transport->expects($this->once())
16-
->method('getName')
17-
->will($this->returnValue('test'));
1815

1916
$this->sessionInput = $this->getMock(
2017
'Symfony\Component\Console\Input\InputInterface'
@@ -39,15 +36,9 @@ public function setUp()
3936
$this->repository = $this->getMock(
4037
'PHPCR\RepositoryInterface'
4138
);
42-
$this->repository->expects($this->once())
43-
->method('login')
44-
->will($this->returnValue($this->session));
45-
46-
$this->transport->expects($this->once())
47-
->method('getRepository')
48-
->will($this->returnValue($this->repository));
4939

5040
$this->application = new ShellApplication('phpcr','v0.test', $this->sessionInput, array($this->transport));
41+
$this->application->setSessionInput($this->sessionInput);
5142
$this->application->setAutoExit(false);
5243
}
5344

0 commit comments

Comments
 (0)