Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ before_script:
script:
- phpunit --coverage-text
- php vendor/behat/behat/bin/behat
- php vendor/bin/phpspec run
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"symfony/process": "2.3.*",
"symfony/filesystem": "2.3.*",
"phpunit/phpunit": "~3.7.28",
"behat/behat": "~2.5"
"behat/behat": "~2.5",
"phpspec/phpspec": "2.0"
},
"license": "MIT",
"authors": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ Feature: Clone a node from a given workspace to the current workspace

Scenario: Clone node
Given the current workspace is "default"
And I execute the "workspace:node:clone default_1 /cms/articles/article1 /cms/clone" command
And I execute the "node:clone /cms/articles/article1 /cms/clone default_1" command
Then the command should not fail
And I save the session
And there should exist a node at "/cms/clone"

Scenario: Clone onto existing
Given I execute the "workspace:node:clone default_1 /cms/articles/article1 /cms/articles" command
Given I execute the "node:clone /cms/articles/article1 /cms/articles default_1" command
Then the command should fail
And I should see the following:
"""
Node already exists at destination
"""

Scenario: Clone onto existing but remove
Given I execute the "workspace:node:clone --remove-existing default_1 /cms/articles/article1 /cms/articles/article1" command
Given I execute the "node:clone --remove-existing /cms/articles/article1 /cms/articles/article1 default_1" command
Then the command should not fail
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Feature: Copy a node from a given workspace to the current workspace
And I purge the current workspace

Scenario: Copy node from a different workspace
Given I execute the "workspace:node:copy /tests_general_base/index.txt /index.txt default_1" command
Given I execute the "node:copy /tests_general_base/index.txt /index.txt default_1" command
Then the command should not fail
And there should exist a node at "/index.txt"

Scenario: Copy node in the same workspace
And I execute the "workspace:node:copy /tests_general_base/index.txt /tests_general_base/index.txt.2" command
Given I execute the "node:copy /tests_general_base/index.txt /tests_general_base/index.txt.2" command
Then the command should not fail
And I save the session
And there should exist a node at "/tests_general_base/index.txt.2"
4 changes: 2 additions & 2 deletions features/node_corresponding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Feature: Display the path of any corresponding node in a given workspace
And the "session_data.xml" fixtures are loaded
And the current workspace is "default"

Scenario: Rename a node
Scenario: Show corresponding nodes
Given the current node is "/tests_general_base/idExample"
And I execute the "node:corresponding default" command
And I execute the "node:corresponding . default" command
Then the command should not fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_definition.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Show CND for node

Scenario: Show node definition
Given the current node is "/tests_general_base"
And I execute the "node:definition --no-ansi" command
And I execute the "node:definition daniel --no-ansi" command
Then the command should fail
And I should see the following:
"""
Expand Down
4 changes: 2 additions & 2 deletions features/node_info.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Feature: Show information about node

Scenario: Show node information
Given the current node is "/tests_general_base"
And I execute the "node:info --no-ansi" command
And I execute the "node:info daniel --no-ansi" command
Then the command should not fail
And I should see the following:
"""
+-------------------+--------------------------------------+
| Path | /tests_general_base |
| Path | /tests_general_base/daniel |
| UUID | N/A |
| Index | 1 |
| Primary node type | nt:unstructured |
Expand Down
2 changes: 1 addition & 1 deletion features/node_lifecycle_follow_transition.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Follow the given lifecycle transition on the current node

Scenario: Follow lifecycle transition
Given the current node is "/tests_general_base"
And I execute the "node:lifecycle:follow foo" command
And I execute the "node:lifecycle:follow daniel foo" command
Then the command should fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_lifecycle_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: List the possible lifecycle transitions for the current node

Scenario: List possible lifecycle transitions
Given the current node is "/tests_general_base"
And I execute the "node:lifecycle:list" command
And I execute the "node:lifecycle:list daniel" command
Then the command should fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_mixin_add.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Add mixin to the current node

Scenario: Add a mixin to the current node
Given the current node is "/tests_general_base"
And I execute the "node:mixin:add mix:versionable --no-ansi" command
And I execute the "node:mixin:add . mix:versionable --no-ansi" command
And I save the session
Then the command should not fail
And the node at "/tests_general_base" should have the mixin "mix:versionable"
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ Feature: Move a node in the current session
And the "session_data.xml" fixtures are loaded

Scenario: Move node
Given I execute the "session:node:move /tests_general_base/index.txt /foobar" command
Given I execute the "node:move /tests_general_base/index.txt /foobar" command
Then the command should not fail
And I execute the "session:save" command
And there should exist a node at "/foobar"
And there should not exist a node at "/tests_general_base/index.txt"

Scenario: Move node relative paths
Given the current node is "/tests_general_base/index.txt"
And I execute the "node:move . /barfoo" command
Then the command should not fail
And I execute the "session:save" command
And there should exist a node at "/barfoo"
And there should not exist a node at "/tests_general_base/index.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Feature: Edit a single property

Examples:
| command |
| session:property:edit /properties/multivalue 1|
| node:property:edit /properties/multivalue 1|

Scenario: Edit multivalue property, no index
Given I execute the "session:property:edit /properties/multivalue" command
Given I execute the "node:property:edit /properties/multivalue" command
Then the command should fail
And I should see the following:
"""
You specified a multivalue property but did not provide an index
"""

Scenario: Edit multivalue property, out of range
Given I execute the "session:property:edit /properties/multivalue 100" command
Given I execute the "node:property:edit /properties/multivalue 100" command
Then the command should fail
And I should see the following:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Feature: Remove a single property at a specified path
And the "cms.xml" fixtures are loaded

Scenario: Remove a property
Given I execute the "session:property:remove /cms/articles/article1/title" command
Given I execute the "node:property:remove /cms/articles/article1/title" command
Then the command should not fail
And I save the session
And there should not exist a property at "/cms/articles/article1/title"

Scenario: Try and remove a node
And I execute the "session:property:remove /tests_general_base" command
And I execute the "node:property:remove /tests_general_base" command
Then the command should fail
And I should see the following:
"""
Expand Down
16 changes: 12 additions & 4 deletions features/node_set.feature → features/node_property_set.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ Feature: Set a node property

Examples:
| command | name | type |
| node:set uri http://foobar | uri | http://foobar |
| node:set double 12.12 | double | 12.12 |
| node:set long 123 | long | 123 |
| node:set thisisnew foobar --type=string | /properties/thisisnew | foobar |
| node:property:set uri http://foobar | uri | http://foobar |
| node:property:set double 12.12 --type=double | double | 12.12 |
| node:property:set long 123 | long | 123 |
| node:property:set thisisnew foobar --type=string | /properties/thisisnew | foobar |

Scenario: Update a property but do not specify the type
Given I execute the "node:set /properties/decimal 1234" command
And I execute the "node:list /properties" command
Then I should see the following:
"""
decimal | DECIMAL
"""
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Display the contents of a single property
And the "session_data.xml" fixtures are loaded

Scenario: Show binary property
Given I execute the "session:property:show /tests_general_base/index.txt/jcr:content/jcr:data" command
Given I execute the "node:property:show /tests_general_base/index.txt/jcr:content/jcr:data" command
Then the command should not fail
And I should see the following:
"""
Expand All @@ -29,15 +29,15 @@ hello world
"""

Scenario: Show date property
Given I execute the "session:property:show /tests_general_base/index.txt/jcr:content/mydateprop" command
Given I execute the "node:property:show /tests_general_base/index.txt/jcr:content/mydateprop" command
Then the command should not fail
And I should see the following:
"""
2011-04-21T14:34:20+01:00
"""

Scenario: Try to show non-existing property
Given I execute the "session:property:show /this/path/does/not/exist" command
Given I execute the "node:property:show /this/path/does/not/exist" command
Then the command should fail
And I should see the following:
"""
Expand Down
6 changes: 3 additions & 3 deletions features/node_references.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Show node references

Scenario: List weak references
Given the current node is "/tests_general_base/idExample/jcr:content/weakreference_target"
And I execute the "node:references --no-ansi" command
And I execute the "node:references . --no-ansi" command
Then the command should not fail
And I should see a table containing the following rows:
| Type | Property | Node Path |
Expand All @@ -18,15 +18,15 @@ Feature: Show node references

Scenario: List named weak references
Given the current node is "/tests_general_base/idExample/jcr:content/weakreference_target"
And I execute the "node:references ref2 --no-ansi" command
And I execute the "node:references . ref2 --no-ansi" command
Then the command should not fail
And I should see a table containing the following rows:
| Type | Property | Node Path |
| weak | ref2 | /tests_general_base/idExample/jcr:content/weakreference_target |

Scenario: List strong references
Given the current node is "/tests_general_base/idExample"
And I execute the "node:references --no-ansi" command
And I execute the "node:references . --no-ansi" command
Then the command should not fail
And I should see a table containing the following rows:
| Type | Property | Node Path |
Expand Down
2 changes: 1 addition & 1 deletion features/node_remove.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Remove a node

Scenario: Remove a node
Given the current node is "/tests_general_base"
And I execute the "node:remove" command
And I execute the "node:remove ." command
Then the command should not fail
And I save the session
And there should not exist a node at "/tests_general_base"
2 changes: 1 addition & 1 deletion features/node_rename.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Rename a node

Scenario: Rename a node
Given the current node is "/tests_general_base/idExample"
And I execute the "node:rename foobar" command
And I execute the "node:rename . foobar" command
And I save the session
Then the command should not fail
And there should exist a node at "/tests_general_base/foobar"
2 changes: 1 addition & 1 deletion features/node_reorder_before.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Reorder a node

Scenario: Reorder a node
Given the current node is "/tests_general_base"
And I execute the "node:order-before emptyExample idExample" command
And I execute the "node:order-before . emptyExample idExample" command
Then the command should not fail
And I save the session
And there should exist a node at "/tests_general_base/emptyExample" before "/tests_general_base/idExample"
2 changes: 1 addition & 1 deletion features/node_set_primary_type.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Set the nodes primary type

Scenario: List the properties and children of the current node
Given the current node is "/tests_general_base"
And I execute the "node:set-primary-type nt:unstructured --no-ansi" command
And I execute the "node:set-primary-type . nt:unstructured --no-ansi" command
Then the command should fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_shared_remove.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Remove the current node from any shared set to which it belongs

Scenario: Remove the current node and all of its shared paths
Given the current node is "/foobar"
And I execute the "node:shared:remove" command
And I execute the "node:shared:remove ." command
Then the command should fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_shared_show.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Show the current nodes shared set

Scenario: Show the current nodes shared set
Given the current node is "/foobar"
And I execute the "node:shared:show" command
And I execute the "node:shared:show ." command
Then the command should fail
And I should see the following:
"""
Expand Down
2 changes: 1 addition & 1 deletion features/node_update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Update the current node from the node to which it corresponds in the gi

Scenario: Update a node
Given the current node is "/foobar"
And I execute the "node:update default_1" command
And I execute the "node:update . default_1" command
Then the command should not fail
And I save the session
And the node at "/foobar" should have the property "title" with value "this is a test"
15 changes: 0 additions & 15 deletions features/session_node_show.feature

This file was deleted.

2 changes: 1 addition & 1 deletion features/version_checkout.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Feature: Checkout a version
Given I execute the "version:checkout /tests_version_base/versioned" command
Then the command should not fail
And the current node is "/tests_version_base/versioned"
And I execute the "node:info" command
And I execute the "node:info ." command
Then I should see the following:
"""
| Checked out? | yes
Expand Down
6 changes: 3 additions & 3 deletions features/version_checkpoint.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Feature: Checkpoint
Scenario: Checkpoint a a given node
Given I execute the following commands:
| cd /tests_version_base/versioned |
| node:set foo bar |
| node:property:set foo bar |
| session:save |
| version:checkpoint /tests_version_base/versioned |
| node:set foo baz |
| node:property:set foo baz |
| session:save |
| version:checkpoint /tests_version_base/versioned |
Then the command should not fail
And I should see the following:
"""
Version: 1.1
"""
And I execute the "node:info" command
And I execute the "node:info ." command
Then I should see the following:
"""
| Checked out? | yes
Expand Down
4 changes: 2 additions & 2 deletions features/version_remove.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Feature: Remove node version
Given I execute the following commands:
| cd /tests_version_base/versioned |
| version:checkout /tests_version_base/versioned |
| node:set foo baz |
| node:property:set foo baz |
| session:save |
| version:checkin /tests_version_base/versioned |
| version:checkout /tests_version_base/versioned |
| node:set foo bar |
| node:property:set foo bar |
| session:save |
| version:checkin /tests_version_base/versioned |
And I execute the "version:remove /tests_version_base/versioned 1.0" command
Expand Down
4 changes: 2 additions & 2 deletions features/version_restore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Feature: Restore a version
Scenario: Restore node version
Given I execute the following commands:
| cd /tests_version_base/versioned |
| node:set foo initalbar |
| node:property:set foo initalbar |
| session:save |
| version:checkpoint /tests_version_base/versioned |
| node:set foo baz |
| node:property:set foo baz |
| session:save |
| version:checkpoint /tests_version_base/versioned |
And I execute the "version:restore /tests_version_base/versioned 1.0" command
Expand Down
Loading