Commit 9b645397 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Adjust tests and flip expected and actual

parent cf023b8e
Pipeline #10142 passed with stages
in 6 minutes and 9 seconds
...@@ -136,7 +136,7 @@ class ExtensionIndexService implements LoggerAwareInterface ...@@ -136,7 +136,7 @@ class ExtensionIndexService implements LoggerAwareInterface
$versionObj->appendChild(new \DOMElement('description', $this->xmlentities((string)$extensionVersionArr['description']))); $versionObj->appendChild(new \DOMElement('description', $this->xmlentities((string)$extensionVersionArr['description'])));
$versionObj->appendChild(new \DOMElement('state', $this->xmlentities((string)$extensionVersionArr['state']))); $versionObj->appendChild(new \DOMElement('state', $this->xmlentities((string)$extensionVersionArr['state'])));
// Use "0" for outdated extension versions as the Extension Manager handles it as insecure // Use "0" for outdated extension versions as the Extension Manager handles it as insecure
$reviewState = (string)((int)$extensionVersionArr['review_state'] !== -2 ?: 0); $reviewState = (string)((int)$extensionVersionArr['review_state'] !== -2 ? $extensionVersionArr['review_state'] : 0);
$versionObj->appendChild(new \DOMElement('reviewstate', $reviewState)); $versionObj->appendChild(new \DOMElement('reviewstate', $reviewState));
$versionObj->appendChild(new \DOMElement('category', $this->xmlentities((string)$extensionVersionArr['em_category']))); $versionObj->appendChild(new \DOMElement('category', $this->xmlentities((string)$extensionVersionArr['em_category'])));
if ($extensionVersionArr['category'] === 'distribution') { if ($extensionVersionArr['category'] === 'distribution') {
......
...@@ -33,7 +33,7 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -33,7 +33,7 @@ class ExtensionIndexServiceTest extends UnitTestCase
<title/> <title/>
<description/> <description/>
<state/> <state/>
<reviewstate/> <reviewstate>0</reviewstate>
<category/> <category/>
<downloadcounter/> <downloadcounter/>
<lastuploaddate/> <lastuploaddate/>
...@@ -54,7 +54,7 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -54,7 +54,7 @@ class ExtensionIndexServiceTest extends UnitTestCase
<title/> <title/>
<description/> <description/>
<state/> <state/>
<reviewstate/> <reviewstate>0</reviewstate>
<category/> <category/>
<downloadcounter/> <downloadcounter/>
<lastuploaddate/> <lastuploaddate/>
...@@ -75,7 +75,7 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -75,7 +75,7 @@ class ExtensionIndexServiceTest extends UnitTestCase
<title/> <title/>
<description/> <description/>
<state/> <state/>
<reviewstate/> <reviewstate>0</reviewstate>
<category/> <category/>
<downloadcounter/> <downloadcounter/>
<lastuploaddate/> <lastuploaddate/>
...@@ -89,6 +89,48 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -89,6 +89,48 @@ class ExtensionIndexServiceTest extends UnitTestCase
<t3xfilemd5/> <t3xfilemd5/>
<documentation_link/> <documentation_link/>
</version> </version>
</extension>
<extension extensionkey="insecure">
<downloadcounter>131313</downloadcounter>
<version version="2.0.0">
<title/>
<description/>
<state/>
<reviewstate>-1</reviewstate>
<category/>
<downloadcounter/>
<lastuploaddate/>
<uploadcomment/>
<dependencies/>
<composerinfo/>
<authorname/>
<authoremail/>
<authorcompany>Security</authorcompany>
<ownerusername>thomas</ownerusername>
<t3xfilemd5/>
<documentation_link/>
</version>
</extension>
<extension extensionkey="outdated">
<downloadcounter>131313</downloadcounter>
<version version="2.0.0">
<title/>
<description/>
<state/>
<reviewstate>0</reviewstate>
<category/>
<downloadcounter/>
<lastuploaddate/>
<uploadcomment/>
<dependencies/>
<composerinfo/>
<authorname/>
<authoremail/>
<authorcompany>Old</authorcompany>
<ownerusername>thomas</ownerusername>
<t3xfilemd5/>
<documentation_link/>
</version>
</extension> </extension>
</extensions> </extensions>
'; ';
...@@ -100,6 +142,7 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -100,6 +142,7 @@ class ExtensionIndexServiceTest extends UnitTestCase
'versions' => [ 'versions' => [
'1.0.0' => [ '1.0.0' => [
'authorcompany' => 'ACME', 'authorcompany' => 'ACME',
'review_state' => 0,
'dependencies' => '[{"kind":"depends","extensionKey":"typo3","versionRange":"8.7.0-10.4.99"}]' 'dependencies' => '[{"kind":"depends","extensionKey":"typo3","versionRange":"8.7.0-10.4.99"}]'
] ]
] ]
...@@ -110,6 +153,7 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -110,6 +153,7 @@ class ExtensionIndexServiceTest extends UnitTestCase
'versions' => [ 'versions' => [
'1.5.0' => [ '1.5.0' => [
'authorcompany' => 't3o', 'authorcompany' => 't3o',
'review_state' => 0,
'dependencies' => '[]' 'dependencies' => '[]'
] ]
] ]
...@@ -120,6 +164,29 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -120,6 +164,29 @@ class ExtensionIndexServiceTest extends UnitTestCase
'versions' => [ 'versions' => [
'2.0.0' => [ '2.0.0' => [
'authorcompany' => 'INC', 'authorcompany' => 'INC',
'review_state' => 0,
'dependencies' => null
]
]
],
'insecure' => [
'downloads' => 131313,
'frontend_user' => 'thomas',
'versions' => [
'2.0.0' => [
'authorcompany' => 'Security',
'review_state' => -1,
'dependencies' => null
]
]
],
'outdated' => [
'downloads' => 131313,
'frontend_user' => 'thomas',
'versions' => [
'2.0.0' => [
'authorcompany' => 'Old',
'review_state' => -2,
'dependencies' => null 'dependencies' => null
] ]
] ]
...@@ -130,6 +197,6 @@ class ExtensionIndexServiceTest extends UnitTestCase ...@@ -130,6 +197,6 @@ class ExtensionIndexServiceTest extends UnitTestCase
$resultString = $result->saveXML(); $resultString = $result->saveXML();
// remove the lines with "<!--Index created // remove the lines with "<!--Index created
$resultString = preg_replace('/\<!--Index created(.*)--\>\n/m', '', $resultString); $resultString = preg_replace('/\<!--Index created(.*)--\>\n/m', '', $resultString);
self::assertEquals($resultString, $expected); self::assertEquals($expected, $resultString);
} }
} }
...@@ -10,12 +10,12 @@ return [ ...@@ -10,12 +10,12 @@ return [
'Connections' => [ 'Connections' => [
'Default' => [ 'Default' => [
'charset' => 'utf8', 'charset' => 'utf8',
'dbname' => getenv('DB_NAME'), 'dbname' => false,
'driver' => 'mysqli', 'driver' => 'mysqli',
'host' => getenv('DB_HOST'), 'host' => false,
'password' => getenv('DB_PASSWORD'), 'password' => false,
'port' => 3306, 'port' => 3306,
'user' => getenv('DB_USERNAME'), 'user' => false,
], ],
], ],
], ],
...@@ -59,12 +59,12 @@ return [ ...@@ -59,12 +59,12 @@ return [
'TYPO3FEUserExist' => '0', 'TYPO3FEUserExist' => '0',
'enableBELDAPAuthentication' => '0', 'enableBELDAPAuthentication' => '0',
'enableBESSO' => '0', 'enableBESSO' => '0',
'enableFELDAPAuthentication' => '1', 'enableFELDAPAuthentication' => '0',
'enableFESSO' => '0', 'enableFESSO' => '0',
'forceLowerCaseUsername' => '0', 'forceLowerCaseUsername' => '0',
'keepBEGroups' => '0', 'keepBEGroups' => '0',
'keepBESSODomainName' => '0', 'keepBESSODomainName' => '0',
'keepFEGroups' => '1', 'keepFEGroups' => '0',
'keepFESSODomainName' => '0', 'keepFESSODomainName' => '0',
'throwExceptionAtLogin' => '1', 'throwExceptionAtLogin' => '1',
'useExtConfConfiguration' => '0', 'useExtConfConfiguration' => '0',
...@@ -74,52 +74,27 @@ return [ ...@@ -74,52 +74,27 @@ return [
'showSampleTasks' => '1', 'showSampleTasks' => '1',
], ],
'solr' => [ 'solr' => [
'allowLegacySiteMode' => '0',
'allowSelfSignedCertificates' => '0', 'allowSelfSignedCertificates' => '0',
'useConfigurationFromClosestTemplate' => '0', 'useConfigurationFromClosestTemplate' => '0',
'useConfigurationMonitorTables' => '', 'useConfigurationMonitorTables' => '',
'useConfigurationTrackRecordsOutsideSiteroot' => '1', 'useConfigurationTrackRecordsOutsideSiteroot' => '1',
], ],
't3olayout' => [ 't3olayout' => [
'loginFormPid' => '12', 'loginFormPid' => '',
'loginPid' => '8', 'loginPid' => '',
], ],
'ter' => [ 'ter' => [
'repositoryDir' => '/var/www/html/private/fileadmin/ter/', 'repositoryDir' => '',
], ],
'ter_rest' => [ 'ter_rest' => [
'routing' => [ 'abandonUser' => '',
'routeArguments' => [ 'apiPath' => '',
'String' => \T3o\TerRest\Routing\RouteArgument\StringArgument::class, 'extensionDownloadUrl' => '',
'Integer' => \T3o\TerRest\Routing\RouteArgument\IntegerArgument::class, 'extensionKeyPattern' => '',
'Object' => \T3o\TerRest\Routing\RouteArgument\ObjectArgument::class, 'extensionMaxUploadSize' => '',
'Array' => \T3o\TerRest\Routing\RouteArgument\ArrayArgument::class 'extensionVersionFiles' => '',
], 'schemaPath' => '',
'formData' => [ ],
'String' => \T3o\TerRest\Routing\FormData\StringData::class,
'Integer' => \T3o\TerRest\Routing\FormData\IntegerData::class,
'Boolean' => \T3o\TerRest\Routing\FormData\BooleanData::class,
'Binary' => \T3o\TerRest\Routing\FormData\BinaryData::class
],
'responseTypes' => [
'*/*' => \TYPO3\CMS\Core\Http\JsonResponse::class,
'application/json' => \TYPO3\CMS\Core\Http\JsonResponse::class
],
'enableFeUserAuthentication' => true
],
'extensionVersionFiles' => '.t3x,.gif,.png,.svg,_Distribution.png,_Distribution.svg,_DistributionWelcome.png,_DistributionWelcome.svg',
'extensionMaxUploadSize' => 31457280,
'extensionKeyPattern' => '^((?!(tx|user|pages|tt|sys|ts_language|csh))[a-z]{1}[a-z0-9_]+)$',
'apiPath' => '/api/',
'schemaPath' => 'EXT:ter_rest/Resources/Private/Schema/',
'extensionDownloadUrl' => 'https://extensions.typo3.org/extension/download/',
'abandonUser' => 'abandoned_extensions',
'randomLength' => getenv('TER_REST_RANDOM_LENGTH'),
'defaultLifetime' => getenv('TER_REST_DEFAULT_LIFETIME'),
'jwtSubject' => getenv('TER_REST_JWT_SUBJECT'),
'jwtLatency' => getenv('TER_REST_JWT_LATENCY'),
'signatureIdentifier' => getenv('TER_REST_SIGNATURE_IDENTIFIER')
]
], ],
'FE' => [ 'FE' => [
'cacheHash' => [ 'cacheHash' => [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment