/** * Method to test handleUpdateRelations(). * * @return void * * @covers Windwalker\Relation\Handler\AbstractRelationHandler::handleUpdateRelations */ public function testHandleUpdateRelations() { $itemTable = new StubTableRose(); $expectedTable = new StubTableRose(); // CASCADE $this->instance->handleUpdateRelations($itemTable); $expectedTable->foo_id = 'Foo'; $expectedTable->bar_id = 'Bar'; $this->assertEquals($expectedTable->getProperties(), $itemTable->getProperties()); // SET NULL $this->instance->getParent()->foo = 5; $this->instance->onUpdate(Action::SET_NULL); $this->instance->handleUpdateRelations($itemTable); $expectedTable->foo_id = null; $expectedTable->bar_id = null; $this->assertEquals($expectedTable->getProperties(), $itemTable->getProperties()); }