setUpStorageSchema example

'table' => 'users',
            'columns' => ['editor' => 'uid'],
          ],
          'entity_test_field__editor_revision__user_id' => [
            'table' => 'users',
            'columns' => ['editor_revision__target_id' => 'uid'],
          ],
        ],
      ],
    ];

    $this->setUpStorageSchema($expected);

    $table_mapping = new TestSqlContentDefaultTableMapping($this->entityType, $this->storageDefinitions);
    $table_mapping->setFieldNames('entity_test', array_keys($this->storageDefinitions));
    $table_mapping->setExtraColumns('entity_test', ['default_langcode']);

    $this->storageSchema->expects($this->any())
      ->method('getTableMapping')
      ->willReturn($table_mapping);

    $this->assertNull(
      $this->storageSchema->onEntityTypeCreate($this->entityType)
    );
Home | Imprint | This part of the site doesn't use cookies.