| @@ 379-399 (lines=21) @@ | ||
| 376 | ); |
|
| 377 | } |
|
| 378 | ||
| 379 | public function testHideUpdateHidden() |
|
| 380 | { |
|
| 381 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 382 | $handler = $this->getLocationGateway(); |
|
| 383 | $handler->hideSubtree('/1/2/69/'); |
|
| 384 | ||
| 385 | $query = $this->handler->createSelectQuery(); |
|
| 386 | $this->assertQueryResult( |
|
| 387 | array( |
|
| 388 | array(1, 0, 0), |
|
| 389 | array(2, 0, 0), |
|
| 390 | array(69, 1, 1), |
|
| 391 | array(75, 0, 1), |
|
| 392 | ), |
|
| 393 | $query |
|
| 394 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 395 | ->from('ezcontentobject_tree') |
|
| 396 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 397 | ->orderBy('node_id') |
|
| 398 | ); |
|
| 399 | } |
|
| 400 | ||
| 401 | /** |
|
| 402 | * @depends testHideUpdateHidden |
|
| @@ 404-425 (lines=22) @@ | ||
| 401 | /** |
|
| 402 | * @depends testHideUpdateHidden |
|
| 403 | */ |
|
| 404 | public function testHideUnhideUpdateHidden() |
|
| 405 | { |
|
| 406 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 407 | $handler = $this->getLocationGateway(); |
|
| 408 | $handler->hideSubtree('/1/2/69/'); |
|
| 409 | $handler->unhideSubtree('/1/2/69/'); |
|
| 410 | ||
| 411 | $query = $this->handler->createSelectQuery(); |
|
| 412 | $this->assertQueryResult( |
|
| 413 | array( |
|
| 414 | array(1, 0, 0), |
|
| 415 | array(2, 0, 0), |
|
| 416 | array(69, 0, 0), |
|
| 417 | array(75, 0, 0), |
|
| 418 | ), |
|
| 419 | $query |
|
| 420 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 421 | ->from('ezcontentobject_tree') |
|
| 422 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 423 | ->orderBy('node_id') |
|
| 424 | ); |
|
| 425 | } |
|
| 426 | ||
| 427 | /** |
|
| 428 | * @depends testHideUpdateHidden |
|