| @@ 266-286 (lines=21) @@ | ||
| 263 | ); |
|
| 264 | } |
|
| 265 | ||
| 266 | public function testHideUpdateHidden() |
|
| 267 | { |
|
| 268 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 269 | $handler = $this->getLocationGateway(); |
|
| 270 | $handler->hideSubtree('/1/2/69/'); |
|
| 271 | ||
| 272 | $query = $this->handler->createSelectQuery(); |
|
| 273 | $this->assertQueryResult( |
|
| 274 | array( |
|
| 275 | array(1, 0, 0), |
|
| 276 | array(2, 0, 0), |
|
| 277 | array(69, 1, 1), |
|
| 278 | array(75, 0, 1), |
|
| 279 | ), |
|
| 280 | $query |
|
| 281 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 282 | ->from('ezcontentobject_tree') |
|
| 283 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 284 | ->orderBy('node_id') |
|
| 285 | ); |
|
| 286 | } |
|
| 287 | ||
| 288 | /** |
|
| 289 | * @depends testHideUpdateHidden |
|
| @@ 291-312 (lines=22) @@ | ||
| 288 | /** |
|
| 289 | * @depends testHideUpdateHidden |
|
| 290 | */ |
|
| 291 | public function testHideUnhideUpdateHidden() |
|
| 292 | { |
|
| 293 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 294 | $handler = $this->getLocationGateway(); |
|
| 295 | $handler->hideSubtree('/1/2/69/'); |
|
| 296 | $handler->unhideSubtree('/1/2/69/'); |
|
| 297 | ||
| 298 | $query = $this->handler->createSelectQuery(); |
|
| 299 | $this->assertQueryResult( |
|
| 300 | array( |
|
| 301 | array(1, 0, 0), |
|
| 302 | array(2, 0, 0), |
|
| 303 | array(69, 0, 0), |
|
| 304 | array(75, 0, 0), |
|
| 305 | ), |
|
| 306 | $query |
|
| 307 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 308 | ->from('ezcontentobject_tree') |
|
| 309 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 310 | ->orderBy('node_id') |
|
| 311 | ); |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * @depends testHideUpdateHidden |
|