Skip to content

Commit 0d0fee0

Browse files
committed
Added node features
1 parent dc2e407 commit 0d0fee0

12 files changed

+146
-6
lines changed

features/node_create.feature

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Feature: Create a node
2+
In order to create a new node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "session_data.xml" fixtures are loaded
9+
10+
Scenario: Create a new node
11+
Given the current node is "/"
12+
And I execute the "node:create testcreate" command
13+
Then the command should not fail
14+
And there should exist a node at "/testcreate"
15+
16+
Scenario: Create a new node at a non-root current node
17+
Given the current node is "/tests_general_base"
18+
And I execute the "node:create testcreate" command
19+
Then the command should not fail
20+
And there should exist a node at "/tests_general_base/testcreate"
21+
22+
Scenario: Create a new node at an absolute path
23+
Given I execute the "node:create /testcreate" command
24+
Then the command should not fail
25+
And there should exist a node at "/testcreate"
26+
27+
Scenario: Create a new node before another node
28+
Given the current node is "/tests_general_base"
29+
Given I execute the "node:create foobar --before unversionable" command
30+
Then the command should not fail
31+
And there should exist a node at "/tests_general_base/foobar" before "/tests_general_base/unversionable"
32+
33+
Scenario: Attempt to create an empty node
34+
Given I execute the "node:create /" command
35+
Then the command should fail
36+
And I should see the following
37+
"""
38+
Invalid node name "/"
39+
"""

features/node_definition.feature

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Feature: Show CND for node
2+
In order to show the compact node definition for a node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "session_data.xml" fixtures are loaded
9+
10+
Scenario: Rename a node
11+
Given the current node is "/tests_general_base"
12+
And I execute the "node:definition --no-ansi" command
13+
Then the command should not fail
14+
And I should see the following:
15+
"""
16+
<nt='http://www.jcp.org/jcr/nt/1.0'>
17+
[nt:unstructured] > nt:base
18+
orderable query
19+
- *
20+
multiple jcr.operator.equal.to', 'jcr.operator.not.equal.to', 'jcr.operator.greater.than', 'jcr.operator.greater.than.or.equal.to', 'jcr.operator.less.than', 'jcr.operator.less.than.or.equal.to', 'jcr.operator.like
21+
- *
22+
jcr.operator.equal.to', 'jcr.operator.not.equal.to', 'jcr.operator.greater.than', 'jcr.operator.greater.than.or.equal.to', 'jcr.operator.less.than', 'jcr.operator.less.than.or.equal.to', 'jcr.operator.like
23+
+ * (nt:base)
24+
= nt:unstructured
25+
VERSION sns
26+
"""

features/node_info.feature

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Feature: Show information about node
2+
In order to show some useful information about the current node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "session_data.xml" fixtures are loaded
9+
10+
Scenario: Rename a node
11+
Given the current node is "/tests_general_base"
12+
And I execute the "node:info --no-ansi" command
13+
Then the command should not fail
14+
And I should see the following:
15+
"""
16+
Identifier: /tests_general_base
17+
Path: /tests_general_base
18+
Index: 0
19+
Primary node type: nt:unstructured
20+
Mixin node types: [ mixin:foobar, mixin:barfoo ]
21+
Checked out: No
22+
"""

features/node_rename.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Feature: Rename a node
2+
In order to rename a node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "session_data.xml" fixtures are loaded
9+
10+
Scenario: Rename a node
11+
Given the current node is "/tests_general_base"
12+
And I execute the "node:rename foobar" command
13+
Then the command should not fail
14+
And there should exist a node at "/tests_general_base/foobar"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Feature: Reorder a node
2+
In order to change the order of a node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "session_data.xml" fixtures are loaded
9+
10+
Scenario: Reorder a node
11+
Given the cnp is "/tests_general_base"
12+
And I execute the "node:order-before unversionable" command
13+
Then the command should not fail
14+
And there should exist a node at "/tests_general_base/simpleVersioned" before "/tests_general_base/unversionable"

features/node_set.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Feature: Set a node property
2+
In order to set a property on a node
3+
As a user that is logged into the shell
4+
I should be able to run a command which does that
5+
6+
Background:
7+
Given that I am logged in as "testuser"
8+
And the "all_property_types.xml" fixtures are loaded
9+
And the current node path is "/properties"
10+
11+
Scenario Outline: Set a property
12+
Given I execute the "<command>" command
13+
Then the command should not fail
14+
And the node at "/properties" should have the property "<name>" with type "<type>"
15+
16+
Examples:
17+
| command | name | type |
18+
| node:set uri http://foobar | uri | http://foobar | url |
19+
| node:set double 12.12 | double | 12.12 | double |
20+
| node:set long 123 | long | 123 | long |
21+
| node:set multivalue value1 --index=0 | multivalue | value1 | string |
22+
| node:set multivalue value2 --index=1 | multivalue | value2 | string |
23+
| node:set thisisnew foobar string | /properties/thisisnew | foobar | string |

features/node_type_edit.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ Feature: Edit a node type
5353
"""
5454
And I execute the "node-type:edit ns:NodeType --no-interaction" command
5555
Then the command should not fail
56-
And there should exist a node type called "ns:somenewtype"
56+
And I should see the following:
57+
"""
58+
gt

src/PHPCR/Shell/Console/Command/NodeTypeListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function execute(InputInterface $input, OutputInterface $output)
3030

3131
$nodeTypes = $nodeTypeManager->getAllNodeTypes();
3232

33-
$table = $this->getHelper('table');
33+
$table = clone $this->getHelper('table');
3434
$table->setHeaders(array('Name', 'Primary Item Name', 'Abstract?', 'Mixin?', 'Queryable?'));
3535

3636
foreach ($nodeTypes as $nodeType) {

src/PHPCR/Shell/Console/Command/RepositoryDescriptorListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function execute(InputInterface $input, OutputInterface $output)
2525
$repository = $session->getRepository();
2626
$keys = $repository->getDescriptorKeys();
2727

28-
$table = $this->getHelper('table');
28+
$table = clone $this->getHelper('table');
2929
$table->setHeaders(array('Key', 'Value'));
3030

3131
foreach ($keys as $key) {

src/PHPCR/Shell/Console/Command/RetentionHoldListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function execute(InputInterface $input, OutputInterface $output)
2929
$absPath = $input->getArgument('absPath');
3030

3131
$holds = $retentionManager->getHolds($absPath);
32-
$table = $this->getHelper('table');
32+
$table = clone $this->getHelper('table');
3333
$table->setHeaders(array('Name'));
3434

3535
foreach ($holds as $hold) {

0 commit comments

Comments
 (0)