@@ 1330-1351 (lines=22) @@ | ||
1327 | /** |
|
1328 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadRelations |
|
1329 | */ |
|
1330 | public function testLoadRelationsByType() |
|
1331 | { |
|
1332 | $this->insertRelationFixture(); |
|
1333 | ||
1334 | $gateway = $this->getDatabaseGateway(); |
|
1335 | ||
1336 | $relations = $gateway->loadRelations(57, null, \eZ\Publish\API\Repository\Values\Content\Relation::COMMON); |
|
1337 | ||
1338 | $this->assertCount(1, $relations, 'Expecting one relation to be loaded'); |
|
1339 | ||
1340 | $this->assertValuesInRows( |
|
1341 | 'ezcontentobject_link_relation_type', |
|
1342 | [\eZ\Publish\API\Repository\Values\Content\Relation::COMMON], |
|
1343 | $relations |
|
1344 | ); |
|
1345 | ||
1346 | $this->assertValuesInRows( |
|
1347 | 'ezcontentobject_link_to_contentobject_id', |
|
1348 | [58], |
|
1349 | $relations |
|
1350 | ); |
|
1351 | } |
|
1352 | ||
1353 | /** |
|
1354 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadRelations |
|
@@ 1410-1431 (lines=22) @@ | ||
1407 | /** |
|
1408 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::loadReverseRelations |
|
1409 | */ |
|
1410 | public function testLoadReverseRelationsWithType() |
|
1411 | { |
|
1412 | $this->insertRelationFixture(); |
|
1413 | ||
1414 | $gateway = $this->getDatabaseGateway(); |
|
1415 | ||
1416 | $relations = $gateway->loadReverseRelations(58, \eZ\Publish\API\Repository\Values\Content\Relation::COMMON); |
|
1417 | ||
1418 | self::assertCount(1, $relations); |
|
1419 | ||
1420 | $this->assertValuesInRows( |
|
1421 | 'ezcontentobject_link_from_contentobject_id', |
|
1422 | [57], |
|
1423 | $relations |
|
1424 | ); |
|
1425 | ||
1426 | $this->assertValuesInRows( |
|
1427 | 'ezcontentobject_link_relation_type', |
|
1428 | [\eZ\Publish\API\Repository\Values\Content\Relation::COMMON], |
|
1429 | $relations |
|
1430 | ); |
|
1431 | } |
|
1432 | ||
1433 | /** |
|
1434 | * Inserts the relation database fixture from relation_data.php. |