| @@ 101-117 (lines=17) @@ | ||
| 98 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation |
|
| 99 | * @dataProvider getUntrashedLocationValues |
|
| 100 | */ |
|
| 101 | public function testUntrashLocationDefault($property, $value) |
|
| 102 | { |
|
| 103 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); |
|
| 104 | $handler = $this->getLocationGateway(); |
|
| 105 | $handler->trashLocation(71); |
|
| 106 | ||
| 107 | $handler->untrashLocation(71); |
|
| 108 | ||
| 109 | $query = $this->handler->createSelectQuery(); |
|
| 110 | $this->assertQueryResult( |
|
| 111 | [[$value]], |
|
| 112 | $query |
|
| 113 | ->select($property) |
|
| 114 | ->from('ezcontentobject_tree') |
|
| 115 | ->where($query->expr->in('contentobject_id', [69])) |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation |
|
| @@ 888-914 (lines=27) @@ | ||
| 885 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase::setCommonTypeColumns |
|
| 886 | * @dataProvider getTypeUpdateExpectations |
|
| 887 | */ |
|
| 888 | public function testUpdateType($fieldName, $expectedValue) |
|
| 889 | { |
|
| 890 | $this->insertDatabaseFixture( |
|
| 891 | __DIR__ . '/_fixtures/existing_types.php' |
|
| 892 | ); |
|
| 893 | ||
| 894 | $gateway = $this->getGateway(); |
|
| 895 | ||
| 896 | $type = $this->getUpdateTypeFixture(); |
|
| 897 | ||
| 898 | $gateway->updateType(1, 0, $type); |
|
| 899 | ||
| 900 | $this->assertQueryResult( |
|
| 901 | [ |
|
| 902 | [ |
|
| 903 | $fieldName => $expectedValue, |
|
| 904 | ], |
|
| 905 | ], |
|
| 906 | $this->getDatabaseHandler() |
|
| 907 | ->createSelectQuery() |
|
| 908 | ->select( |
|
| 909 | $fieldName |
|
| 910 | )->from('ezcontentclass') |
|
| 911 | ->where('id = 1 AND version = 0'), |
|
| 912 | "Incorrect value stored for '{$fieldName}'." |
|
| 913 | ); |
|
| 914 | } |
|
| 915 | ||
| 916 | /** |
|
| 917 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase::deleteTypeNameData |
|