| @@ 335-365 (lines=31) @@ | ||
| 332 | /** |
|
| 333 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed |
|
| 334 | */ |
|
| 335 | public function testListTrashSortedPathStringDesc() |
|
| 336 | { |
|
| 337 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 338 | $handler = $this->getLocationGateway(); |
|
| 339 | $this->trashSubtree(); |
|
| 340 | ||
| 341 | $this->assertEquals( |
|
| 342 | [ |
|
| 343 | '/1/2/69/76/', |
|
| 344 | '/1/2/69/72/75/', |
|
| 345 | '/1/2/69/72/74/', |
|
| 346 | '/1/2/69/72/73/', |
|
| 347 | '/1/2/69/72/', |
|
| 348 | '/1/2/69/70/71/', |
|
| 349 | '/1/2/69/70/', |
|
| 350 | '/1/2/69/', |
|
| 351 | ], |
|
| 352 | array_map( |
|
| 353 | function ($trashItem) { |
|
| 354 | return $trashItem['path_string']; |
|
| 355 | }, |
|
| 356 | $trashList = $handler->listTrashed( |
|
| 357 | 0, |
|
| 358 | null, |
|
| 359 | [ |
|
| 360 | new SortClause\Location\Path(Query::SORT_DESC), |
|
| 361 | ] |
|
| 362 | ) |
|
| 363 | ) |
|
| 364 | ); |
|
| 365 | } |
|
| 366 | ||
| 367 | /** |
|
| 368 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed |
|
| @@ 370-401 (lines=32) @@ | ||
| 367 | /** |
|
| 368 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed |
|
| 369 | */ |
|
| 370 | public function testListTrashSortedDepth() |
|
| 371 | { |
|
| 372 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 373 | $handler = $this->getLocationGateway(); |
|
| 374 | $this->trashSubtree(); |
|
| 375 | ||
| 376 | $this->assertEquals( |
|
| 377 | [ |
|
| 378 | '/1/2/69/', |
|
| 379 | '/1/2/69/76/', |
|
| 380 | '/1/2/69/72/', |
|
| 381 | '/1/2/69/70/', |
|
| 382 | '/1/2/69/72/75/', |
|
| 383 | '/1/2/69/72/74/', |
|
| 384 | '/1/2/69/72/73/', |
|
| 385 | '/1/2/69/70/71/', |
|
| 386 | ], |
|
| 387 | array_map( |
|
| 388 | function ($trashItem) { |
|
| 389 | return $trashItem['path_string']; |
|
| 390 | }, |
|
| 391 | $trashList = $handler->listTrashed( |
|
| 392 | 0, |
|
| 393 | null, |
|
| 394 | [ |
|
| 395 | new SortClause\Location\Depth(), |
|
| 396 | new SortClause\Location\Path(Query::SORT_DESC), |
|
| 397 | ] |
|
| 398 | ) |
|
| 399 | ) |
|
| 400 | ); |
|
| 401 | } |
|
| 402 | ||
| 403 | /** |
|
| 404 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::cleanupTrash |
|