TASK: Make tests compatible with TYPO3 CMS 7.6

As there is no doctrine, we receive values as string, also for uid.
This commit is contained in:
Daniel Siepmann 2018-03-15 08:07:28 +01:00
parent 56bfc4f75a
commit 5a0a4931e4
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 30 additions and 6 deletions

View file

@ -50,7 +50,11 @@ class NonAllowedTablesTest extends AbstractDataHandlerTest
$this->subject->expects($this->exactly(1))
->method('update')
->with('pages', $this->callback(function (array $record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
}));
$tce = GeneralUtility::makeInstance(Typo3DataHandler::class);
@ -73,7 +77,11 @@ class NonAllowedTablesTest extends AbstractDataHandlerTest
$this->subject->expects($this->exactly(1))
->method('update')
->with('pages', $this->callback(function (array $record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
}));
$tce = GeneralUtility::makeInstance(Typo3DataHandler::class);
@ -96,7 +104,11 @@ class NonAllowedTablesTest extends AbstractDataHandlerTest
$this->subject->expects($this->exactly(1))
->method('update')
->with('pages', $this->callback(function (array $record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
}));
$tce = GeneralUtility::makeInstance(Typo3DataHandler::class);

View file

@ -53,7 +53,11 @@ class ProcessesAllowedTablesTest extends AbstractDataHandlerTest
$this->subject->expects($this->exactly(1))
->method('update')
->with('pages', $this->callback(function (array $record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
}));
$tce = GeneralUtility::makeInstance(Typo3DataHandler::class);
@ -94,7 +98,11 @@ class ProcessesAllowedTablesTest extends AbstractDataHandlerTest
[
$this->equalTo('pages'),
$this->callback(function ($record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
})
]
);
@ -137,7 +145,11 @@ class ProcessesAllowedTablesTest extends AbstractDataHandlerTest
[
$this->equalTo('pages'),
$this->callback(function ($record) {
if ($this->isLegacyVersion()) {
return isset($record['uid']) && $record['uid'] === '1';
} else {
return isset($record['uid']) && $record['uid'] === 1;
}
})
]
);