Skip to content

Commit

Permalink
[REMOVAL] Remove Core::getRegisteredFormsForTables and Core::getRegis…
Browse files Browse the repository at this point in the history
…teredFormForTable

Methods were no longer associated with an active feature.
  • Loading branch information
NamelessCoder committed Aug 13, 2023
1 parent 2ebbc5d commit c068901
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
30 changes: 0 additions & 30 deletions Classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class Core
const CONTROLLER_ALL = '_all';

protected static array $providers = [];
private static array $forms = [
'tables' => [],
];
private static array $unregisteredProviders = [];
protected static array $extensions = [
self::CONTROLLER_ALL => []
Expand All @@ -46,17 +43,6 @@ public static function clearQueuedContentTypeRegistrations(): void
self::$queuedContentTypeRegistrations = [];
}

public static function registerFormForTable(string $table, Form $form): void
{
if (null === $form->getName()) {
$form->setName($table);
}
if (null === $form->getExtensionName() && isset($GLOBALS['_EXTKEY'])) {
$form->setExtensionName(GeneralUtility::underscoredToUpperCamelCase($GLOBALS['_EXTKEY']));
}
self::$forms['tables'][$table] = $form;
}

public static function registerProviderExtensionKey(
string $extensionKey,
string $providesControllerName = self::CONTROLLER_ALL
Expand Down Expand Up @@ -292,22 +278,6 @@ public static function getRegisteredFlexFormProviders(): array
return self::$providers;
}

/**
* @return Form[]
*/
public static function getRegisteredFormsForTables(): array
{
return self::$forms['tables'];
}

public static function getRegisteredFormForTable(string $table): ?Form
{
if (true === isset(self::$forms['tables'][$table])) {
return self::$forms['tables'][$table];
}
return null;
}

protected static function getAbsolutePathForFilename(string $filename): string
{
if (strpos($filename, '://') !== false) {
Expand Down
29 changes: 0 additions & 29 deletions Tests/Unit/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,6 @@ public function returnsEmptyArrayForUnknownExtensionKeysAndControllerObjects()
$this->assertEmpty($registered);
}

/**
* @test
*/
public function canRegisterFormInstanceForTable()
{
$table = 'this_table_does_not_exist';
$form = $this->getMockBuilder(Form::class)->setMethods(['dummy'])->getMock();
AccessibleCore::registerFormForTable($table, $form);
$forms = AccessibleCore::getRegisteredFormsForTables();
$this->assertArrayHasKey($table, $forms);
$returnedForm = AccessibleCore::getRegisteredFormForTable($table);
$incorrectReturnedForm = AccessibleCore::getRegisteredFormForTable($table . 'badname');
$this->assertSame($form, $returnedForm);
$this->assertNull($incorrectReturnedForm);
}

/**
* @test
*/
Expand Down Expand Up @@ -245,17 +229,4 @@ public function canUnregisterNotCurrentlyRegisteredProviders()
AccessibleCore::registerConfigurationProvider($fakeClass);
$this->assertNotContains($fakeClass, AccessibleCore::getRegisteredFlexFormProviders());
}

/**
* @test
*/
public function registerFormForTableSetsExtensionNameFromExtensionKeyGlobal()
{
$GLOBALS['_EXTKEY'] = 'test';
$form = $this->getMockBuilder(Form::class)->setMethods(['setExtensionName', 'getExtensionName'])->getMock();
$form->method('getExtensionName')->willReturn(null);
$form->expects($this->once())->method('setExtensionName')->with('Test');
AccessibleCore::registerFormForTable('foobar', $form);
unset($GLOBALS['_EXTKEY']);
}
}

0 comments on commit c068901

Please sign in to comment.