Skip to content

Commit f1f25b3

Browse files
committed
Merge pull request #7 from phpcr/behat
Behat
2 parents 4691870 + 7f2e48e commit f1f25b3

File tree

130 files changed

+5430
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+5430
-207
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ php:
88
before_script:
99
- composer self-update
1010
- composer install --dev
11+
- bash tests/bin/travis_jackrabbit.sh
1112

12-
script: phpunit --coverage-text
13+
script:
14+
- phpunit --coverage-text
15+
- php vendor/behat/behat/bin/behat

README.md

Lines changed: 4 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -60,87 +60,9 @@ Options:
6060
--repo-url (-url) URL of repository (e.g. for jackrabbit). (default: "http://localhost:8080/server/")
6161
````
6262

63-
## Executing Select Queries
63+
## TODO
6464

65-
JCR_SQL2 Select queries can be executed in the same way as in the MySQL shell:
65+
- Versioning:
66+
- Activity
67+
- Configuration
6668

67-
````bash
68-
PHPCR > SELECT * FROM [nt:unstructured];
69-
70-
| Row: #13 Score: 3
71-
| Sel: nt:unstructured Path: /functional/Lyon_65019 UID: e6e74fdb-d329-4405-abd6-317bd0a9a325
72-
+--------------------+--------+----------+--------------------------------------+
73-
| Name | Type | Multiple | Value |
74-
+--------------------+--------+----------+--------------------------------------+
75-
| phpcr:classparents | String | yes | |
76-
| phpcr:class | String | no | Doctrine\Tests\Models\CMS\CmsAddress |
77-
| jcr:uuid | String | no | e6e74fdb-d329-4405-abd6-317bd0a9a325 |
78-
| jcr:mixinTypes | Name | yes | [0] phpcr:managed |
79-
| | | | [1] mix:referenceable |
80-
| country | String | no | France |
81-
| jcr:primaryType | Name | no | nt:unstructured |
82-
| city | String | no | Lyon |
83-
| zip | String | no | 65019 |
84-
+--------------------+--------+----------+--------------------------------------+
85-
86-
| Row: #14 Score: 3
87-
| Sel: nt:unstructured Path: /functional/anonymous UID: 40d35c13-083a-447d-a86a-04bfee2f0608
88-
+--------------------+--------+----------+--------------------------------------+
89-
| Name | Type | Multiple | Value |
90-
+--------------------+--------+----------+--------------------------------------+
91-
| phpcr:class | String | no | Doctrine\Tests\Models\CMS\CmsUser |
92-
| phpcr:classparents | String | yes | |
93-
| jcr:uuid | String | no | 40d35c13-083a-447d-a86a-04bfee2f0608 |
94-
| jcr:mixinTypes | Name | yes | [0] phpcr:managed |
95-
| | | | [1] mix:referenceable |
96-
| username | String | no | anonymous |
97-
| jcr:primaryType | Name | no | nt:unstructured |
98-
+--------------------+--------+----------+--------------------------------------+
99-
100-
2 rows in set (0.04 sec)
101-
````
102-
103-
## Changing the CWD
104-
105-
The PHPCR shell allows you to navigate the PHPCR document hierarchy like a file system
106-
107-
````bash
108-
PHPCR > ls
109-
ROOT:
110-
cms/
111-
foobar/
112-
some-node
113-
PHPCR > cd cms/foobar
114-
PHPCR > pwd
115-
/cms/foobar
116-
PHPCR > mv foobar /barfoo
117-
````
118-
119-
## All other commands
120-
121-
The PHPCR shell wraps all the commands of the `phpcr-utils` package, list
122-
them with the `list` command:
123-
124-
````bash
125-
PHPCR> list
126-
Available commands:
127-
cd Change the current path
128-
exit Logout and quit the shell
129-
help Displays help for a command
130-
list Lists commands
131-
ls Alias for dump
132-
mv Moves a node from one path to another
133-
nt-list List all available node types in the repository
134-
nt-register Register node types in the PHPCR repository
135-
pwd Print Working Directory (or path)
136-
rm Remove content from the repository
137-
select Execute an JCR_SQL2 query.
138-
touch Create or modify a node
139-
update Command to manipulate the nodes in the workspace.
140-
workspace-create Create a workspace in the configured repository
141-
workspace-delete Delete a workspace from the configured repository
142-
workspace-export Export nodes from the repository, either to the JCR system view format or the document view format
143-
workspace-import Import xml data into the repository, either in JCR system view format or arbitrary xml
144-
workspace-list List all available workspaces in the configured repository
145-
workspace-purge Remove all nodes from a workspace
146-
````

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
"phpcr/phpcr": "dev-master",
1010
"phpcr/phpcr-utils": "dev-master"
1111
},
12+
"require-dev": {
13+
"mockery/mockery": "0.9",
14+
"symfony/process": "2.3.*",
15+
"symfony/filesystem": "2.3.*",
16+
"phpunit/phpunit": "~3.7.28",
17+
"behat/behat": "~2.5"
18+
},
1219
"license": "MIT",
1320
"authors": [
1421
{
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Feature: List the ac privileges for a given node
2+
In order to show the privleges for a given node
3+
As a logged in user
4+
I want to be able to execute a command which does that
5+
6+
Scenario: Listing privileges
7+
Given that I am logged in as "testuser"
8+
And I execute the "access-control:privilege:list /tests_general_base" command
9+
Then I should see the following:
10+
"""
11+
Unsupported repository operation
12+
"""
13+
#Then the command should not fail
14+
#And I should see a table containing the following rows:
15+
# | Name | Abstract? | Aggregate ? |
16+
# | foo | yes | no |
17+
18+
# Scenario: Listing all supported privileges
19+
# Given I execute the "access-control:privilege:list /tests_general_base --supported --verbose" command
20+
# Then the command should not fail
21+
# And I should see a table containing the following rows:
22+
# | Name | Abstract? | Aggregate ? |
23+
# | foo | yes | no |
24+
#
25+
# Scenario: List non node privileges
26+
# Given that I am logged in as "testuser"
27+
# And I execute the "access-control:privilege:list" command
28+
# Then the command should not fail
29+
# And I should see a table containing the following rows:
30+
# | Name | Abstract? | Aggregate ? |
31+
# | foo | yes | no |

0 commit comments

Comments
 (0)