Skip to content

Commit 3052e45

Browse files
committed
Fixed some other features
1 parent 535407c commit 3052e45

File tree

6 files changed

+39
-21
lines changed

6 files changed

+39
-21
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function beforeScenario()
6161
/**
6262
* Cleans test folders in the temporary directory.
6363
*
64-
* @BeforeSuite
6564
* @AfterSuite
6665
*/
6766
public static function cleanTestFolders()
@@ -785,4 +784,13 @@ public function theNodeShouldNotBeLocked($arg1)
785784

786785
PHPUnit_Framework_Assert::assertFalse($isLocked);
787786
}
787+
788+
/**
789+
* @Given /^I purge the current workspace$/
790+
*/
791+
public function iPurgeTheCurrentWorkspace()
792+
{
793+
$session = $this->getSession();
794+
NodeHelper::purgeWorkspace($session);
795+
}
788796
}

features/lock_token_remove.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Remove a lock token in the current session
99
Scenario: Create a new node
1010
Given I execute the "lock:token:remove foobar" command
1111
Then the command should fail
12-
Then I should not see the following:
12+
Then I should see the following:
1313
"""
1414
Not implemented
1515
"""

features/workspace_namespace_register.feature

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ Feature: Register a namespace on the workspace
55

66
Background:
77
Given that I am logged in as "testuser"
8-
And the "clean.xml" system view fixtures are loaded
98

10-
Scenario: List namespaces
11-
Given I execute the "workspace:namespace:register dcms http://foobar.com/ns" command
12-
Then the command should not fail
9+
# We cannot test namespace registration because jackrabbit does not support
10+
# namespace unregistration, so we simply try doing something which provokes
11+
# to throw an exception.
12+
Scenario: Attemp to register a default namespace
13+
Given I execute the "workspace:namespace:register foo http\://www.jcp.org/jcr/nt/1.0" command
14+
Then the command should fail
15+
And I should see the following:
16+
"""
17+
Can not change default namespace
18+
"""

features/workspace_namespace_unregister.feature

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Feature: Unregister a namespace on the workspace
55

66
Background:
77
Given that I am logged in as "testuser"
8-
And the "session_data.xml" fixtures are loaded
98

10-
Scenario: List namespaces
11-
Given the namespace "http://foobar.com/ns" with prefix "foo" exists
12-
And I execute the "workspace:namespace:unregister http://foobar.com/ns" command
9+
# We cannot test namespace registration because jackrabbit does not support
10+
# namespace unregistration, so we simply try doing something which provokes
11+
# to throw an exception.
12+
Scenario: Attemp to unregister a default namespace
13+
Given I execute the "workspace:namespace:unregister internal" command
1314
Then the command should fail
1415
And I should see the following:
1516
"""
16-
not supported by jackrabbit backend
17+
Unregistering namespace not supported by jackrabbit backend
1718
"""

features/workspace_node_clone.feature

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ Feature: Clone a node from a given workspace to the current workspace
1010
And the current workspace is "default"
1111
And the "cms.xml" fixtures are loaded
1212

13-
# Scenario: Clone node
14-
# Given the current workspace is "default"
15-
# And I execute the "workspace:node:clone default_1 /cms/articles/article1 /cms/clone" command
16-
# Then the command should not fail
17-
# And I save the session
18-
# And there should exist a node at "/cms/clone"
13+
Scenario: Clone node
14+
Given the current workspace is "default"
15+
And I execute the "workspace:node:clone default_1 /cms/articles/article1 /cms/clone" command
16+
Then the command should not fail
17+
And I save the session
18+
And there should exist a node at "/cms/clone"
1919

2020
Scenario: Clone onto existing
2121
Given I execute the "workspace:node:clone default_1 /cms/articles/article1 /cms/articles" command
2222
Then the command should fail
23+
And I should see the following:
24+
"""
25+
Node already exists at destination
26+
"""
2327

2428
Scenario: Clone onto existing but remove
2529
Given I execute the "workspace:node:clone --remove-existing default_1 /cms/articles/article1 /cms/articles/article1" command

features/workspace_node_copy.feature

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ Feature: Copy a node from a given workspace to the current workspace
77
Given that I am logged in as "testuser"
88
And the current workspace is "default_1"
99
And the "session_data.xml" fixtures are loaded
10-
And the "all_property_types.xml" fixtures are loaded
1110
And the current workspace is "default"
1211
And I purge the current workspace
1312

1413
Scenario: Copy node from a different workspace
15-
Given I execute the "workspace:node:copy /tests_general_base/index.txt /index.txt test" command
14+
Given I execute the "workspace:node:copy /tests_general_base/index.txt /index.txt default_1" command
1615
Then the command should not fail
1716
And there should exist a node at "/index.txt"
1817

1918
Scenario: Copy node in the same workspace
20-
And I execute the "workspace:node:copy /tests_general_base/index.txt /index.txt" command
19+
And I execute the "workspace:node:copy /tests_general_base/index.txt /tests_general_base/index.txt.2" command
2120
Then the command should not fail
2221
And I save the session
23-
And there should exist a node at "/index.txt"
22+
And there should exist a node at "/tests_general_base/index.txt.2"

0 commit comments

Comments
 (0)