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