| @@ 403-427 (lines=25) @@ | ||
| 400 | /** |
|
| 401 | * @depends testHideUpdateHidden |
|
| 402 | */ |
|
| 403 | public function testHideUnhideParentTree() |
|
| 404 | { |
|
| 405 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 406 | $handler = $this->getLocationGateway(); |
|
| 407 | $handler->hideSubtree('/1/2/69/'); |
|
| 408 | $handler->hideSubtree('/1/2/69/70/'); |
|
| 409 | $handler->unhideSubtree('/1/2/69/'); |
|
| 410 | ||
| 411 | $query = $this->handler->createSelectQuery(); |
|
| 412 | $this->assertQueryResult( |
|
| 413 | [ |
|
| 414 | [1, 0, 0], |
|
| 415 | [2, 0, 0], |
|
| 416 | [69, 0, 0], |
|
| 417 | [70, 1, 1], |
|
| 418 | [71, 0, 1], |
|
| 419 | [75, 0, 0], |
|
| 420 | ], |
|
| 421 | $query |
|
| 422 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 423 | ->from('ezcontentobject_tree') |
|
| 424 | ->where($query->expr->in('node_id', [1, 2, 69, 70, 71, 75])) |
|
| 425 | ->orderBy('node_id') |
|
| 426 | ); |
|
| 427 | } |
|
| 428 | ||
| 429 | /** |
|
| 430 | * @depends testHideUpdateHidden |
|
| @@ 432-456 (lines=25) @@ | ||
| 429 | /** |
|
| 430 | * @depends testHideUpdateHidden |
|
| 431 | */ |
|
| 432 | public function testHideUnhidePartialSubtree() |
|
| 433 | { |
|
| 434 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 435 | $handler = $this->getLocationGateway(); |
|
| 436 | $handler->hideSubtree('/1/2/69/'); |
|
| 437 | $handler->hideSubtree('/1/2/69/70/'); |
|
| 438 | $handler->unhideSubtree('/1/2/69/70/'); |
|
| 439 | ||
| 440 | $query = $this->handler->createSelectQuery(); |
|
| 441 | $this->assertQueryResult( |
|
| 442 | [ |
|
| 443 | [1, 0, 0], |
|
| 444 | [2, 0, 0], |
|
| 445 | [69, 1, 1], |
|
| 446 | [70, 0, 1], |
|
| 447 | [71, 0, 1], |
|
| 448 | [75, 0, 1], |
|
| 449 | ], |
|
| 450 | $query |
|
| 451 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 452 | ->from('ezcontentobject_tree') |
|
| 453 | ->where($query->expr->in('node_id', [1, 2, 69, 70, 71, 75])) |
|
| 454 | ->orderBy('node_id') |
|
| 455 | ); |
|
| 456 | } |
|
| 457 | ||
| 458 | public function testSwapLocations() |
|
| 459 | { |
|