| @@ 122-138 (lines=17) @@ | ||
| 119 | /** |
|
| 120 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation |
|
| 121 | */ |
|
| 122 | public function testUntrashLocationNewParent() |
|
| 123 | { |
|
| 124 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 125 | $handler = $this->getLocationGateway(); |
|
| 126 | $handler->trashLocation(71); |
|
| 127 | ||
| 128 | $handler->untrashLocation(71, 1); |
|
| 129 | ||
| 130 | $query = $this->handler->createSelectQuery(); |
|
| 131 | $this->assertQueryResult( |
|
| 132 | [['228', '1', '/1/228/']], |
|
| 133 | $query |
|
| 134 | ->select('node_id', 'parent_node_id', 'path_string') |
|
| 135 | ->from('ezcontentobject_tree') |
|
| 136 | ->where($query->expr->in('contentobject_id', [69])) |
|
| 137 | ); |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation |
|
| @@ 688-712 (lines=25) @@ | ||
| 685 | /** |
|
| 686 | * @dataProvider getUpdateLocationData |
|
| 687 | */ |
|
| 688 | public function testUpdateLocation($field, $value) |
|
| 689 | { |
|
| 690 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 691 | $handler = $this->getLocationGateway(); |
|
| 692 | $handler->update( |
|
| 693 | new Location\UpdateStruct( |
|
| 694 | [ |
|
| 695 | 'priority' => 23, |
|
| 696 | 'remoteId' => 'someNewHash', |
|
| 697 | 'sortField' => 4, |
|
| 698 | 'sortOrder' => 4, |
|
| 699 | ] |
|
| 700 | ), |
|
| 701 | 70 |
|
| 702 | ); |
|
| 703 | ||
| 704 | $query = $this->handler->createSelectQuery(); |
|
| 705 | $this->assertQueryResult( |
|
| 706 | [[$value]], |
|
| 707 | $query |
|
| 708 | ->select($field) |
|
| 709 | ->from('ezcontentobject_tree') |
|
| 710 | ->where($query->expr->in('node_id', [70])) |
|
| 711 | ); |
|
| 712 | } |
|
| 713 | ||
| 714 | public static function getNodeAssignmentValues() |
|
| 715 | { |
|