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