public function RelationAPITest::testRelationDelete in Relation 8
Same name and namespace in other branches
- 8.2 src/Tests/RelationAPITest.php \Drupal\relation\Tests\RelationAPITest::testRelationDelete()
Tests relation delete.
File
- src/
Tests/ RelationAPITest.php, line 275
Class
- RelationAPITest
- Test general API for Relation.
Namespace
Drupal\relation\TestsCode
public function testRelationDelete() {
// Invalid relations are deleted when any endpoint entity is deleted.
// Octopus relation is valid with 3 endpoints, currently it has 4.
$this->node1
->delete();
$this
->assertTrue(Relation::load($this->relation_id_octopus), 'Relation is not deleted.');
$this->node2
->delete();
$this
->assertFalse(Relation::load($this->relation_id_octopus), 'Relation is deleted.');
}