@@ -52,7 +52,7 @@ public function testCreateViewObject()
52
52
public function testCreateView ()
53
53
{
54
54
$ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
55
- $ result = $ this ->viewHandler ->createView ($ this ->view );
55
+ $ result = $ this ->viewHandler ->create ($ this ->view );
56
56
static ::assertEquals ('View1 ' . '_ ' . static ::$ testsTimestamp , $ result ['name ' ]);
57
57
static ::assertEquals ('arangosearch ' , $ result ['type ' ]);
58
58
}
@@ -63,9 +63,9 @@ public function testCreateView()
63
63
public function testGetView ()
64
64
{
65
65
$ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
66
- $ this ->viewHandler ->createView ($ this ->view );
66
+ $ this ->viewHandler ->create ($ this ->view );
67
67
68
- $ result = $ this ->viewHandler ->getView ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
68
+ $ result = $ this ->viewHandler ->get ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
69
69
static ::assertEquals ('View1 ' . '_ ' . static ::$ testsTimestamp , $ result ->getName ());
70
70
static ::assertEquals ('arangosearch ' , $ result ->getType ());
71
71
}
@@ -76,7 +76,7 @@ public function testGetView()
76
76
public function testGetNonExistingView ()
77
77
{
78
78
try {
79
- $ this ->viewHandler ->getView ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
79
+ $ this ->viewHandler ->get ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
80
80
} catch (\Exception $ exception ) {
81
81
}
82
82
static ::assertEquals (404 , $ exception ->getCode ());
@@ -88,7 +88,7 @@ public function testGetNonExistingView()
88
88
public function testViewProperties ()
89
89
{
90
90
$ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
91
- $ result = $ this ->viewHandler ->createView ($ this ->view );
91
+ $ result = $ this ->viewHandler ->create ($ this ->view );
92
92
static ::assertEquals ('View1 ' . '_ ' . static ::$ testsTimestamp , $ result ['name ' ]);
93
93
static ::assertEquals ('arangosearch ' , $ result ['type ' ]);
94
94
@@ -103,7 +103,7 @@ public function testViewProperties()
103
103
public function testViewSetProperties ()
104
104
{
105
105
$ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
106
- $ result = $ this ->viewHandler ->createView ($ this ->view );
106
+ $ result = $ this ->viewHandler ->create ($ this ->view );
107
107
static ::assertEquals ('View1 ' . '_ ' . static ::$ testsTimestamp , $ result ['name ' ]);
108
108
static ::assertEquals ('arangosearch ' , $ result ['type ' ]);
109
109
@@ -124,8 +124,8 @@ public function testViewSetProperties()
124
124
public function testDropView ()
125
125
{
126
126
$ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
127
- $ this ->viewHandler ->createView ($ this ->view );
128
- $ result = $ this ->viewHandler ->dropView ('View1 ' . '_ ' . static ::$ testsTimestamp );
127
+ $ this ->viewHandler ->create ($ this ->view );
128
+ $ result = $ this ->viewHandler ->drop ('View1 ' . '_ ' . static ::$ testsTimestamp );
129
129
static ::assertTrue ($ result );
130
130
}
131
131
@@ -135,7 +135,42 @@ public function testDropView()
135
135
public function testDropNonExistingView ()
136
136
{
137
137
try {
138
- $ this ->viewHandler ->dropView ('View1 ' . '_ ' . static ::$ testsTimestamp );
138
+ $ this ->viewHandler ->drop ('View1 ' . '_ ' . static ::$ testsTimestamp );
139
+ } catch (\Exception $ exception ) {
140
+ }
141
+ static ::assertEquals (404 , $ exception ->getCode ());
142
+ }
143
+
144
+ /**
145
+ * Test rename view
146
+ */
147
+ public function testRenameView ()
148
+ {
149
+ if (isCluster ($ this ->connection )) {
150
+ // don't execute this test in a cluster
151
+ $ this ->markTestSkipped ("test is only meaningful in a single server " );
152
+ return ;
153
+ }
154
+ $ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
155
+ $ this ->viewHandler ->create ($ this ->view );
156
+ $ result = $ this ->viewHandler ->rename ('View1 ' . '_ ' . static ::$ testsTimestamp , 'View2 ' . '_ ' . static ::$ testsTimestamp );
157
+ static ::assertTrue ($ result );
158
+ }
159
+
160
+ /**
161
+ * Test rename a non-existing view
162
+ */
163
+ public function testRenameNonExistingView ()
164
+ {
165
+ if (isCluster ($ this ->connection )) {
166
+ // don't execute this test in a cluster
167
+ $ this ->markTestSkipped ("test is only meaningful in a single server " );
168
+ return ;
169
+ }
170
+ $ this ->view = new View ('View1 ' . '_ ' . static ::$ testsTimestamp , 'arangosearch ' );
171
+ $ this ->viewHandler ->create ($ this ->view );
172
+ try {
173
+ $ this ->viewHandler ->rename ('View2 ' . '_ ' . static ::$ testsTimestamp , 'View1 ' . '_ ' . static ::$ testsTimestamp );
139
174
} catch (\Exception $ exception ) {
140
175
}
141
176
static ::assertEquals (404 , $ exception ->getCode ());
@@ -145,11 +180,11 @@ public function tearDown()
145
180
{
146
181
$ this ->viewHandler = new ViewHandler ($ this ->connection );
147
182
try {
148
- $ this ->viewHandler ->dropView ('View1 ' . '_ ' . static ::$ testsTimestamp );
183
+ $ this ->viewHandler ->drop ('View1 ' . '_ ' . static ::$ testsTimestamp );
149
184
} catch (Exception $ e ) {
150
185
}
151
186
try {
152
- $ this ->viewHandler ->dropView ('View2 ' . '_ ' . static ::$ testsTimestamp );
187
+ $ this ->viewHandler ->drop ('View2 ' . '_ ' . static ::$ testsTimestamp );
153
188
} catch (Exception $ e ) {
154
189
}
155
190
}
0 commit comments