Skip to content

Commit c53b149

Browse files
committed
Updated aliases
1 parent 6f1ccef commit c53b149

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/PHPCR/Shell/PhpcrSession.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ public function getAbsPath($path)
118118
*/
119119
public function getAbsTargetPath($srcPath, $targetPath)
120120
{
121+
$targetPath = $this->getAbsPath($targetPath);
122+
121123
try {
122-
$this->getNode($this->getAbsPath($targetPath));
124+
$this->getNode($targetPath);
123125
} catch (PathNotFoundException $e) {
124126
return $targetPath;
125127
}
126128

127129
$basename = basename($this->getAbsPath($srcPath));
128130

129-
return sprintf('%s/%s', $targetPath, $basename);
131+
return $this->getAbsPath(sprintf('%s/%s', $targetPath, $basename));
130132
}
131133

132134
public function getAbsPaths($paths)

src/PHPCR/Shell/Resources/config.dist/alias.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Shell shortcuts
2-
alist: shell:alias:list
2+
lsa: shell:alias:list
33
creload: shell:config:reload
44
cinit: shell:config:init
55

@@ -22,16 +22,16 @@ cat: node:property:show {arg1}
2222
touch: node:property:set {arg1} {arg2} {arg3}
2323

2424
# Node type commands
25-
mixins: node-type:list "^mix:"
26-
ntlist: node-type:list
25+
lsmix: node-type:list "^mix:"
26+
lsnt: node-type:list {arg1}
2727
ntedit: node-type:edit {arg1}
2828
ntshow: node-type:show {arg1}
2929

3030
# Workspace commands
3131
wslist: workspace:list
3232

3333
# Namespsce commands
34-
nslist: workspace:namespace:list
34+
lsns: workspace:namespace:list {arg1}
3535
nsset: workspace:namespace:register
3636

3737
# Editor commands
@@ -42,12 +42,11 @@ nano: node:property:edit {arg1} {arg2}
4242
man: help {arg1}
4343

4444
# Version commands
45-
checkin: version:checkin {arg1}
46-
checkout: version:checkout {arg1}
47-
checkpoint: version:checkpoint {arg1}
48-
checkpoint: version:checkpoint {arg1}
49-
vhlist: version:history {arg1}
45+
ci: version:checkin {arg1}
46+
co: version:checkout {arg1}
47+
cp: version:checkpoint {arg1}
48+
vhist: version:history {arg1}
5049

5150
# Session commands
5251
save: session:save
53-
reload: session:reload
52+
refresh: session:refresh

tests/PHPCR/Shell/PhpcrSessionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace PHPCR\Shell;
44

55
use PHPCR\SessionInterface;
6+
use PHPCR\PathNotFoundException;
67

78
class PhpcrSessionTest extends \Phpunit_Framework_TestCase
89
{
@@ -73,6 +74,9 @@ public function testMv($cwd, $relSrc, $relTar, $expSrc, $expTar)
7374
$this->phpcr->expects($this->once())
7475
->method('move')
7576
->with($expSrc, $expTar);
77+
$this->phpcr->expects($this->once())
78+
->method('getNode')
79+
->will($this->throwException(new PathNotFoundException));
7680
$this->session->setCwd($cwd);
7781
$this->session->move($relSrc, $relTar);
7882
}

0 commit comments

Comments
 (0)