| @@ 317-341 (lines=25) @@ | ||
| 314 | /** |
|
| 315 | * @depends testHideUpdateHidden |
|
| 316 | */ |
|
| 317 | public function testHideUnhideParentTree() |
|
| 318 | { |
|
| 319 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 320 | $handler = $this->getLocationGateway(); |
|
| 321 | $handler->hideSubtree('/1/2/69/'); |
|
| 322 | $handler->hideSubtree('/1/2/69/70/'); |
|
| 323 | $handler->unhideSubtree('/1/2/69/'); |
|
| 324 | ||
| 325 | $query = $this->handler->createSelectQuery(); |
|
| 326 | $this->assertQueryResult( |
|
| 327 | array( |
|
| 328 | array(1, 0, 0), |
|
| 329 | array(2, 0, 0), |
|
| 330 | array(69, 0, 0), |
|
| 331 | array(70, 1, 1), |
|
| 332 | array(71, 0, 1), |
|
| 333 | array(75, 0, 0), |
|
| 334 | ), |
|
| 335 | $query |
|
| 336 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 337 | ->from('ezcontentobject_tree') |
|
| 338 | ->where($query->expr->in('node_id', array(1, 2, 69, 70, 71, 75))) |
|
| 339 | ->orderBy('node_id') |
|
| 340 | ); |
|
| 341 | } |
|
| 342 | ||
| 343 | /** |
|
| 344 | * @depends testHideUpdateHidden |
|
| @@ 346-370 (lines=25) @@ | ||
| 343 | /** |
|
| 344 | * @depends testHideUpdateHidden |
|
| 345 | */ |
|
| 346 | public function testHideUnhidePartialSubtree() |
|
| 347 | { |
|
| 348 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 349 | $handler = $this->getLocationGateway(); |
|
| 350 | $handler->hideSubtree('/1/2/69/'); |
|
| 351 | $handler->hideSubtree('/1/2/69/70/'); |
|
| 352 | $handler->unhideSubtree('/1/2/69/70/'); |
|
| 353 | ||
| 354 | $query = $this->handler->createSelectQuery(); |
|
| 355 | $this->assertQueryResult( |
|
| 356 | array( |
|
| 357 | array(1, 0, 0), |
|
| 358 | array(2, 0, 0), |
|
| 359 | array(69, 1, 1), |
|
| 360 | array(70, 0, 1), |
|
| 361 | array(71, 0, 1), |
|
| 362 | array(75, 0, 1), |
|
| 363 | ), |
|
| 364 | $query |
|
| 365 | ->select('node_id', 'is_hidden', 'is_invisible') |
|
| 366 | ->from('ezcontentobject_tree') |
|
| 367 | ->where($query->expr->in('node_id', array(1, 2, 69, 70, 71, 75))) |
|
| 368 | ->orderBy('node_id') |
|
| 369 | ); |
|
| 370 | } |
|
| 371 | ||
| 372 | public function testSwapLocations() |
|
| 373 | { |
|