Commit 362affba authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Andreas Fernandez
Browse files

[TASK] Call static PHPUnit methods via self:: instead of $this->

Class \PHPUnit\Framework\TestCase provides many assertion methods
that can be called statically and dynamically in the context of
tests. Sebastian Bergmann states that neither using $this nor
self/static is right or wrong.

There are two reasons to use self/static however. First of all
IDE's like PhpStorm support code inspections that tell you to
not call static methods dynamically and therefore make your
code look like a christmas tree. Secondly, there is a rule
for php-cs-fixer that can take care of the initial change
and which helps sticking to one specific format, unifying
the code style overall.

Releases: master
Resolves: #89499
Change-Id: Ib4a43a94a0df220b052b88b3c3e37e716560e996
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62095


Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Manuel Selbach's avatarManuel Selbach <manuel_selbach@yahoo.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Manuel Selbach's avatarManuel Selbach <manuel_selbach@yahoo.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 50223f64
......@@ -82,6 +82,7 @@ return PhpCsFixer\Config::create()
'no_useless_else' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_no_access' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
......
......@@ -159,6 +159,6 @@ class ClipboardTest extends FunctionalTestCase
$this->subject->getLocalizations('pages', $record),
'title'
);
static::assertEqualsCanonicalizing($expectation, $actualResult);
self::assertEqualsCanonicalizing($expectation, $actualResult);
}
}
......@@ -53,8 +53,8 @@ class SiteConfigurationOverridesTest extends FunctionalTestCase
{
$columnsConfiguration = $this->subject['site']['columns'];
$this->assertArrayHasKey('tx_a_a', $columnsConfiguration);
$this->assertArrayHasKey('tx_b_a', $columnsConfiguration);
self::assertArrayHasKey('tx_a_a', $columnsConfiguration);
self::assertArrayHasKey('tx_b_a', $columnsConfiguration);
}
/**
......@@ -64,8 +64,8 @@ class SiteConfigurationOverridesTest extends FunctionalTestCase
{
$showitemConfiguration = $this->subject['site']['types']['0']['showitem'];
$this->assertSame(1, mb_substr_count($showitemConfiguration, 'tx_a_a'));
$this->assertSame(1, mb_substr_count($showitemConfiguration, 'tx_b_a'));
self::assertSame(1, mb_substr_count($showitemConfiguration, 'tx_a_a'));
self::assertSame(1, mb_substr_count($showitemConfiguration, 'tx_b_a'));
}
/**
......@@ -75,6 +75,6 @@ class SiteConfigurationOverridesTest extends FunctionalTestCase
{
$columnsConfiguration = $this->subject['site']['columns'];
$this->assertSame('Awesome description by extension b', $columnsConfiguration['tx_a_a']['description']);
self::assertSame('Awesome description by extension b', $columnsConfiguration['tx_a_a']['description']);
}
}
......@@ -57,9 +57,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function usergroupConditionMatchesSingleGroupId(): void
{
$this->assertTrue($this->subject->match('[usergroup(13)]'));
$this->assertTrue($this->subject->match('[usergroup("13")]'));
$this->assertTrue($this->subject->match('[usergroup(\'13\')]'));
self::assertTrue($this->subject->match('[usergroup(13)]'));
self::assertTrue($this->subject->match('[usergroup("13")]'));
self::assertTrue($this->subject->match('[usergroup(\'13\')]'));
}
/**
......@@ -69,8 +69,8 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function usergroupConditionMatchesMultipleUserGroupId(): void
{
$this->assertTrue($this->subject->match('[usergroup("999,15,14,13")]'));
$this->assertTrue($this->subject->match('[usergroup(\'999,15,14,13\')]'));
self::assertTrue($this->subject->match('[usergroup("999,15,14,13")]'));
self::assertTrue($this->subject->match('[usergroup(\'999,15,14,13\')]'));
}
/**
......@@ -80,8 +80,8 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function loginUserConditionMatchesAnyLoggedInUser(): void
{
$this->assertTrue($this->subject->match('[loginUser("*")]'));
$this->assertTrue($this->subject->match('[loginUser(\'*\')]'));
self::assertTrue($this->subject->match('[loginUser("*")]'));
self::assertTrue($this->subject->match('[loginUser(\'*\')]'));
}
/**
......@@ -91,9 +91,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function loginUserConditionMatchesSingleLoggedInUser(): void
{
$this->assertTrue($this->subject->match('[loginUser(13)]'));
$this->assertTrue($this->subject->match('[loginUser("13")]'));
$this->assertTrue($this->subject->match('[loginUser(\'13\')]'));
self::assertTrue($this->subject->match('[loginUser(13)]'));
self::assertTrue($this->subject->match('[loginUser("13")]'));
self::assertTrue($this->subject->match('[loginUser(\'13\')]'));
}
/**
......@@ -104,9 +104,9 @@ class ConditionMatcherTest extends FunctionalTestCase
public function loginUserConditionDoesNotMatchSingleLoggedInUser(): void
{
$GLOBALS['BE_USER']->user['uid'] = 13;
$this->assertFalse($this->subject->match('[loginUser(999)]'));
$this->assertFalse($this->subject->match('[loginUser("999")]'));
$this->assertFalse($this->subject->match('[loginUser(\'999\')]'));
self::assertFalse($this->subject->match('[loginUser(999)]'));
self::assertFalse($this->subject->match('[loginUser("999")]'));
self::assertFalse($this->subject->match('[loginUser(\'999\')]'));
}
/**
......@@ -116,8 +116,8 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function loginUserConditionMatchesMultipleLoggedInUsers(): void
{
$this->assertTrue($this->subject->match('[loginUser("999,13")]'));
$this->assertTrue($this->subject->match('[loginUser(\'999,13\')]'));
self::assertTrue($this->subject->match('[loginUser("999,13")]'));
self::assertTrue($this->subject->match('[loginUser(\'999,13\')]'));
}
/**
......@@ -127,9 +127,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function adminUserConditionMatchesAdminUser(): void
{
$this->assertTrue($this->subject->match('[backend.user.isAdmin == true]'));
$this->assertTrue($this->subject->match('[backend.user.isAdmin != false]'));
$this->assertTrue($this->subject->match('[backend.user.isAdmin]'));
self::assertTrue($this->subject->match('[backend.user.isAdmin == true]'));
self::assertTrue($this->subject->match('[backend.user.isAdmin != false]'));
self::assertTrue($this->subject->match('[backend.user.isAdmin]'));
}
/**
......@@ -141,7 +141,7 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$this->subject->setPageId(2);
$this->subject->__construct();
$this->assertTrue($this->subject->match('[tree.level == 2]'));
self::assertTrue($this->subject->match('[tree.level == 2]'));
}
/**
......@@ -153,7 +153,7 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$this->subject->setPageId(2);
$this->subject->__construct();
$this->assertTrue($this->subject->match('[tree.level in [999,998,2]]'));
self::assertTrue($this->subject->match('[tree.level in [999,998,2]]'));
}
/**
......@@ -163,7 +163,7 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function treeLevelConditionDoesNotMatchFaultyValue(): void
{
$this->assertFalse($this->subject->match('[tree.level == 999]'));
self::assertFalse($this->subject->match('[tree.level == 999]'));
}
/**
......@@ -175,9 +175,9 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$this->subject->setPageId(3);
$this->subject->__construct();
$this->assertTrue($this->subject->match('[2 in tree.rootLineIds]'));
$this->assertTrue($this->subject->match('["2" in tree.rootLineIds]'));
$this->assertTrue($this->subject->match('[\'2\' in tree.rootLineIds]'));
self::assertTrue($this->subject->match('[2 in tree.rootLineIds]'));
self::assertTrue($this->subject->match('["2" in tree.rootLineIds]'));
self::assertTrue($this->subject->match('[\'2\' in tree.rootLineIds]'));
}
/**
......@@ -188,7 +188,7 @@ class ConditionMatcherTest extends FunctionalTestCase
public function PIDupinRootlineConditionDoesNotMatchPageIdNotInRootline(): void
{
$this->subject->setPageId(3);
$this->assertFalse($this->subject->match('[999 in tree.rootLineIds]'));
self::assertFalse($this->subject->match('[999 in tree.rootLineIds]'));
}
/**
......@@ -200,7 +200,7 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$this->subject->setPageId(3);
$this->subject->__construct();
$this->assertTrue($this->subject->match('[2 in tree.rootLineIds]'));
self::assertTrue($this->subject->match('[2 in tree.rootLineIds]'));
}
/**
......@@ -212,7 +212,7 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$this->subject->setPageId(3);
$this->subject->__construct();
$this->assertTrue($this->subject->match('[3 in tree.rootLineIds]'));
self::assertTrue($this->subject->match('[3 in tree.rootLineIds]'));
}
/**
......@@ -223,7 +223,7 @@ class ConditionMatcherTest extends FunctionalTestCase
public function PIDinRootlineConditionDoesNotMatchPageIdNotInRootline(): void
{
$this->subject->setPageId(3);
$this->assertFalse($this->subject->match('[999 in tree.rootLineIds]'));
self::assertFalse($this->subject->match('[999 in tree.rootLineIds]'));
}
/**
......@@ -234,9 +234,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function compatVersionConditionMatchesOlderRelease(): void
{
$this->assertTrue($this->subject->match('[compatVersion(7.0)]'));
$this->assertTrue($this->subject->match('[compatVersion("7.0")]'));
$this->assertTrue($this->subject->match('[compatVersion(\'7.0\')]'));
self::assertTrue($this->subject->match('[compatVersion(7.0)]'));
self::assertTrue($this->subject->match('[compatVersion("7.0")]'));
self::assertTrue($this->subject->match('[compatVersion(\'7.0\')]'));
}
/**
......@@ -247,9 +247,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function compatVersionConditionMatchesSameRelease(): void
{
$this->assertTrue($this->subject->match('[compatVersion(' . TYPO3_branch . ')]'));
$this->assertTrue($this->subject->match('[compatVersion("' . TYPO3_branch . '")]'));
$this->assertTrue($this->subject->match('[compatVersion(\'' . TYPO3_branch . '\')]'));
self::assertTrue($this->subject->match('[compatVersion(' . TYPO3_branch . ')]'));
self::assertTrue($this->subject->match('[compatVersion("' . TYPO3_branch . '")]'));
self::assertTrue($this->subject->match('[compatVersion(\'' . TYPO3_branch . '\')]'));
}
/**
......@@ -260,9 +260,9 @@ class ConditionMatcherTest extends FunctionalTestCase
*/
public function compatVersionConditionDoesNotMatchNewerRelease(): void
{
$this->assertFalse($this->subject->match('[compatVersion(15.0)]'));
$this->assertFalse($this->subject->match('[compatVersion("15.0")]'));
$this->assertFalse($this->subject->match('[compatVersion(\'15.0\')]'));
self::assertFalse($this->subject->match('[compatVersion(15.0)]'));
self::assertFalse($this->subject->match('[compatVersion("15.0")]'));
self::assertFalse($this->subject->match('[compatVersion(\'15.0\')]'));
}
/**
......@@ -274,6 +274,6 @@ class ConditionMatcherTest extends FunctionalTestCase
{
$testKey = $this->getUniqueId('test');
putenv($testKey . '=testValue');
$this->assertTrue($this->subject->match('[getenv("' . $testKey . '") == "testValue"]'));
self::assertTrue($this->subject->match('[getenv("' . $testKey . '") == "testValue"]'));
}
}
......@@ -75,7 +75,7 @@ class FormInlineAjaxControllerTest extends FunctionalTestCase
$body = (string)$response->getBody();
$jsonArray = json_decode($body, true);
$this->assertNotEmpty($jsonArray['data']);
self::assertNotEmpty($jsonArray['data']);
}
/**
......@@ -99,7 +99,7 @@ class FormInlineAjaxControllerTest extends FunctionalTestCase
$body = (string)$response->getBody();
$jsonArray = json_decode($body, true);
$this->assertNotEmpty($jsonArray['data']);
self::assertNotEmpty($jsonArray['data']);
}
/**
......@@ -122,7 +122,7 @@ class FormInlineAjaxControllerTest extends FunctionalTestCase
$body = (string)$response->getBody();
$jsonArray = json_decode($body, true);
$this->assertRegExp('/<option value="1"[^>]* selected="selected">Dansk<\/option>/', $jsonArray['data']);
self::assertRegExp('/<option value="1"[^>]* selected="selected">Dansk<\/option>/', $jsonArray['data']);
}
/**
......@@ -149,7 +149,7 @@ class FormInlineAjaxControllerTest extends FunctionalTestCase
$body = (string)$response->getBody();
$jsonArray = json_decode($body, true);
$this->assertNotRegExp('/<select[^>]* name="data\[tx_irretutorial_1ncsv_offer\]\[NEW[1-9]+\]\[sys_language_uid\]"[^>]*>/', $jsonArray['data']);
self::assertNotRegExp('/<select[^>]* name="data\[tx_irretutorial_1ncsv_offer\]\[NEW[1-9]+\]\[sys_language_uid\]"[^>]*>/', $jsonArray['data']);
}
/**
......
......@@ -214,7 +214,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
]);
$usedLanguages = (string)$this->subject->getUsedLanguagesInPage($request)->getBody();
$this->assertThat($usedLanguages, $this->stringContains('"uid":0'));
self::assertThat($usedLanguages, self::stringContains('"uid":0'));
}
/**
......@@ -237,7 +237,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
$localizeSummary = $this->getReducedRecordLocalizeSummary();
$this->assertEquals($expectedRecords, $localizeSummary);
self::assertEquals($expectedRecords, $localizeSummary);
}
/**
......@@ -260,7 +260,7 @@ class LocalizationControllerTest extends AbstractDataHandlerActionTestCase
$localizeSummary = $this->getReducedRecordLocalizeSummary();
$this->assertEquals($expectedRecords, $localizeSummary);
self::assertEquals($expectedRecords, $localizeSummary);
}
/**
......
......@@ -142,6 +142,6 @@ class PageLayoutControllerTest extends FunctionalTestCase
$this->backendUser->workspace = $workspaceId;
$this->subject->_set('id', $pageId);
$actualResult = $this->subject->_call('currentPageHasSubPages');
static::assertSame($expectation, $actualResult);
self::assertSame($expectation, $actualResult);
}
}
......@@ -110,7 +110,7 @@ class LocalizationRepositoryTest extends \TYPO3\TestingFramework\Core\Functional
public function fetchOriginLanguage(int $pageId, int $localizedLanguage, ?array $expectedResult): void
{
$result = $this->subject->fetchOriginLanguage($pageId, $localizedLanguage);
$this->assertEquals($expectedResult, $result);
self::assertEquals($expectedResult, $result);
}
/**
......@@ -167,7 +167,7 @@ class LocalizationRepositoryTest extends \TYPO3\TestingFramework\Core\Functional
public function getLocalizedRecordCount(int $pageId, int $localizedLanguage, int $expectedResult): void
{
$result = $this->subject->getLocalizedRecordCount($pageId, $localizedLanguage);
$this->assertEquals($expectedResult, $result);
self::assertEquals($expectedResult, $result);
}
/**
......@@ -231,6 +231,6 @@ class LocalizationRepositoryTest extends \TYPO3\TestingFramework\Core\Functional
{
$result = $this->subject->getRecordsToCopyDatabaseResult($pageId, $destLanguageId, $languageId, 'uid');
$result = $result->fetchAll();
$this->assertEquals($expectedResult, $result);
self::assertEquals($expectedResult, $result);
}
}
......@@ -53,9 +53,9 @@ class RecordHistoryStoreTest extends FunctionalTestCase
public function addRecordAddsARecordToTheDatabase(): void
{
$correlationId = CorrelationId::forSubject('092a640c-bd8c-490d-b993-ed4bcef1a1f2');
$this->assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
$this->subject->addRecord('foo', 1, [], $correlationId);
$this->assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
}
/**
......@@ -64,9 +64,9 @@ class RecordHistoryStoreTest extends FunctionalTestCase
public function modifyRecordAddsARecordToTheDatabase(): void
{
$correlationId = CorrelationId::forSubject('058f117c-5e21-4222-b308-085fc1113604');
$this->assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
$this->subject->modifyRecord('foo', 1, [], $correlationId);
$this->assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
}
/**
......@@ -75,9 +75,9 @@ class RecordHistoryStoreTest extends FunctionalTestCase
public function deleteRecordAddsARecordToTheDatabase(): void
{
$correlationId = CorrelationId::forSubject('e1a2ea91-fe2f-4a01-b50b-5c2924a27568');
$this->assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
$this->subject->deleteRecord('foo', 1, $correlationId);
$this->assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
}
/**
......@@ -86,9 +86,9 @@ class RecordHistoryStoreTest extends FunctionalTestCase
public function undeleteRecordAddsARecordToTheDatabase(): void
{
$correlationId = CorrelationId::forSubject('ab902256-56f2-43bd-b857-f7a0b974e9db');
$this->assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
$this->subject->undeleteRecord('foo', 1, $correlationId);
$this->assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
}
/**
......@@ -97,8 +97,8 @@ class RecordHistoryStoreTest extends FunctionalTestCase
public function moveRecordAddsARecordToTheDatabase(): void
{
$correlationId = CorrelationId::forSubject('9d806d3a-1d7a-4e62-816f-9fa1a1b3fe5b');
$this->assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(0, $this->getRecordCountByCorrelationId($correlationId));
$this->subject->moveRecord('foo', 1, [], $correlationId);
$this->assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
self::assertSame(1, $this->getRecordCountByCorrelationId($correlationId));
}
}
......@@ -52,6 +52,6 @@ class RecordHistoryTest extends FunctionalTestCase
*/
public function findEventsForCorrelationWorksAsExpected(string $correlationId, int $amountOfEntries): void
{
$this->assertCount($amountOfEntries, $this->subject->findEventsForCorrelation($correlationId));
self::assertCount($amountOfEntries, $this->subject->findEventsForCorrelation($correlationId));
}
}
......@@ -71,11 +71,11 @@ class PageLayoutViewTest extends FunctionalTestCase
preg_match_all('/<option value=.+<\/option>/', $result, $matches);
$resultingOptions = GeneralUtility::trimExplode('</option>', $matches[0][0], true);
$this->assertCount(4, $resultingOptions);
self::assertCount(4, $resultingOptions);
// first entry is the empty option
$this->assertStringEndsWith('german', $resultingOptions[1]);
$this->assertStringEndsWith('french', $resultingOptions[2]);
$this->assertStringEndsWith('polish', $resultingOptions[3]);
self::assertStringEndsWith('german', $resultingOptions[1]);
self::assertStringEndsWith('french', $resultingOptions[2]);
self::assertStringEndsWith('polish', $resultingOptions[3]);
}
/**
......@@ -90,9 +90,9 @@ class PageLayoutViewTest extends FunctionalTestCase
preg_match_all('/<option value=.+<\/option>/', $result, $matches);
$resultingOptions = GeneralUtility::trimExplode('</option>', $matches[0][0], true);
$this->assertCount(3, $resultingOptions);
self::assertCount(3, $resultingOptions);
// first entry is the empty option
$this->assertStringEndsWith('german', $resultingOptions[1]);
$this->assertStringEndsWith('french', $resultingOptions[2]);
self::assertStringEndsWith('german', $resultingOptions[1]);
self::assertStringEndsWith('french', $resultingOptions[2]);
}
}
......@@ -34,8 +34,8 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/EditRecordViewHelper/WithUidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[a_table][42]=edit', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[a_table][42]=edit', $result);
}
/**
......@@ -47,8 +47,8 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/EditRecordViewHelper/InlineWithUidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[b_table][21]=edit', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[b_table][21]=edit', $result);
}
/**
......@@ -60,9 +60,9 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/EditRecordViewHelper/WithUidTableAndReturnUrl.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[c_table][43]=edit', $result);
$this->assertStringContainsString('returnUrl=foo/bar', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[c_table][43]=edit', $result);
self::assertStringContainsString('returnUrl=foo/bar', $result);
}
/**
......
......@@ -34,8 +34,8 @@ class NewRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/NewRecordViewHelper/WithPidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[a_table][17]=new', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[a_table][17]=new', $result);
}
/**
......@@ -47,8 +47,8 @@ class NewRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/NewRecordViewHelper/WithTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[a_table][0]=new', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[a_table][0]=new', $result);
}
/**
......@@ -60,8 +60,8 @@ class NewRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/NewRecordViewHelper/InlineWithPidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[b_table][17]=new', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[b_table][17]=new', $result);
}
/**
......@@ -73,9 +73,9 @@ class NewRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/NewRecordViewHelper/WithPidTableAndReturnUrl.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[c_table][17]=new', $result);
$this->assertStringContainsString('returnUrl=foo/bar', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[c_table][17]=new', $result);
self::assertStringContainsString('returnUrl=foo/bar', $result);
}
/**
......@@ -87,8 +87,8 @@ class NewRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Link/NewRecordViewHelper/WithNegativeUid.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[c_table][-11]=new', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[c_table][-11]=new', $result);
}
/**
......
......@@ -34,8 +34,8 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Uri/EditRecordViewHelper/WithUidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[a_table][42]=edit', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[a_table][42]=edit', $result);
}
/**
......@@ -47,8 +47,8 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Uri/EditRecordViewHelper/InlineWithUidAndTable.html');
$result = urldecode($view->render());
$this->assertStringContainsString('route=/record/edit', $result);
$this->assertStringContainsString('edit[b_table][21]=edit', $result);
self::assertStringContainsString('route=/record/edit', $result);
self::assertStringContainsString('edit[b_table][21]=edit', $result);
}
/**
......@@ -60,9 +60,9 @@ class EditRecordViewHelperTest extends FunctionalTestCase
$view->setTemplatePathAndFilename('EXT:backend/Tests/Functional/ViewHelpers/Fixtures/Uri/EditRecordViewHelper/WithUidTableAndReturnUrl.html');
$result = urldecode($view->render());