| @@ 346-366 (lines=21) @@ | ||
| 343 | ); |
|
| 344 | } |
|
| 345 | ||
| 346 | public function testHideUpdateHidden() |
|
| 347 | { |
|
| 348 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 349 | $handler = $this->getLocationGateway(); |
|
| 350 | $handler->hideSubtree('/1/2/69/'); |
|
| 351 | ||
| 352 | $query = $this->handler->createSelectQuery(); |
|
| 353 | $this->assertQueryResult( |
|
| 354 | array( |
|
| 355 | array(1, 0, 0), |
|
| 356 | array(2, 0, 0), |
|
| 357 | array(69, 1, 1), |
|
| 358 | array(75, 0, 1), |
|
| 359 | ), |
|
| 360 | $query |
|
| 361 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 362 | ->from('ezcontentobject_tree') |
|
| 363 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 364 | ->orderBy('node_id') |
|
| 365 | ); |
|
| 366 | } |
|
| 367 | ||
| 368 | /** |
|
| 369 | * @depends testHideUpdateHidden |
|
| @@ 371-392 (lines=22) @@ | ||
| 368 | /** |
|
| 369 | * @depends testHideUpdateHidden |
|
| 370 | */ |
|
| 371 | public function testHideUnhideUpdateHidden() |
|
| 372 | { |
|
| 373 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 374 | $handler = $this->getLocationGateway(); |
|
| 375 | $handler->hideSubtree('/1/2/69/'); |
|
| 376 | $handler->unhideSubtree('/1/2/69/'); |
|
| 377 | ||
| 378 | $query = $this->handler->createSelectQuery(); |
|
| 379 | $this->assertQueryResult( |
|
| 380 | array( |
|
| 381 | array(1, 0, 0), |
|
| 382 | array(2, 0, 0), |
|
| 383 | array(69, 0, 0), |
|
| 384 | array(75, 0, 0), |
|
| 385 | ), |
|
| 386 | $query |
|
| 387 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 388 | ->from('ezcontentobject_tree') |
|
| 389 | ->where($query->expr->in('node_id', array(1, 2, 69, 75))) |
|
| 390 | ->orderBy('node_id') |
|
| 391 | ); |
|
| 392 | } |
|
| 393 | ||
| 394 | /** |
|
| 395 | * @depends testHideUpdateHidden |
|