/**
* @test
* @testdox Creating first widget of given type creates new option
*/
public function creatingFirstWidgetOfGivenTypeCreatesOption()
{
self::$worker->prepare_createWidget();
$this->commitAsserter->reset();
self::$worker->createWidget();
$this->commitAsserter->assertNumCommits(1);
if (self::$testConfig->end2endTestType === 'selenium' && WpVersionComparer::compare(self::$testConfig->testSite->wpVersion, '4.4-beta1') >= 0) {
$this->commitAsserter->assertCommitAction('option/edit');
$this->commitAsserter->assertCommitPath('M', '%vpdb%/options/%VPID%.ini');
} else {
$this->commitAsserter->assertCommitAction('option/create');
$this->commitAsserter->assertCommitPath('A', '%vpdb%/options/%VPID%.ini');
}
$this->commitAsserter->assertCountOfAffectedFiles(2);
$this->commitAsserter->assertCleanWorkingDirectory();
DBAsserter::assertFilesEqualDatabase();
}