protected function setUp(): void
{ parent::
setUp();
$this->migration =
$this->
createMock(MigrationInterface::
class);
$this->migration->
method('id'
)->
willReturn('foo'
);
} /**
* Tests different connection types.
*/
public function testConnectionTypes() { $sql_base =
new TestSqlBase([],
$this->migration
);
// Verify that falling back to the default 'migrate' connection (defined in
// the base class) works.
$this->
assertSame('default',
$sql_base->
getDatabase()->
getTarget());
$this->
assertSame('migrate',
$sql_base->
getDatabase()->
getKey());
// Verify the fallback state key overrides the 'migrate' connection.
$target = 'test_fallback_target';
$key = 'test_fallback_key';
$config =
['target' =>
$target, 'key' =>
$key];
$database_state_key = 'test_fallback_state';