diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-07-16 08:05:39 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-07-16 08:05:39 +0300 |
commit | 59b8f31a83df7d9f35a307477512ab84d1322e4c (patch) | |
tree | 0190e91a6d94c2a43e91785bf967d0c316fbe9d1 /test | |
parent | 346923e20a1e00adf98bf1e9164118dc05ad22ba (diff) | |
parent | 519522428e606b62d5a3468889574733c367e03b (diff) |
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test')
-rw-r--r-- | test/classes/Engines/BinlogTest.php | 1 | ||||
-rw-r--r-- | test/classes/Engines/MemoryTest.php | 1 | ||||
-rw-r--r-- | test/classes/Engines/MrgMyisamTest.php | 1 | ||||
-rw-r--r-- | test/classes/Engines/MyisamTest.php | 1 | ||||
-rw-r--r-- | test/classes/Engines/NdbclusterTest.php | 1 | ||||
-rw-r--r-- | test/classes/Engines/PbxtTest.php | 2 | ||||
-rw-r--r-- | test/classes/Engines/PerformanceSchemaTest.php | 1 | ||||
-rw-r--r-- | test/classes/ErrorHandlerTest.php | 2 | ||||
-rw-r--r-- | test/classes/GitTest.php | 56 | ||||
-rw-r--r-- | test/classes/LanguageTest.php | 114 |
10 files changed, 88 insertions, 92 deletions
diff --git a/test/classes/Engines/BinlogTest.php b/test/classes/Engines/BinlogTest.php index 045dc6d983..1010b0327a 100644 --- a/test/classes/Engines/BinlogTest.php +++ b/test/classes/Engines/BinlogTest.php @@ -22,6 +22,7 @@ class BinlogTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new Binlog('binlog'); } diff --git a/test/classes/Engines/MemoryTest.php b/test/classes/Engines/MemoryTest.php index a24b1e955c..0d09df7f55 100644 --- a/test/classes/Engines/MemoryTest.php +++ b/test/classes/Engines/MemoryTest.php @@ -22,6 +22,7 @@ class MemoryTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new Memory('memory'); } diff --git a/test/classes/Engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php index 20ac355d6a..3829b8cc67 100644 --- a/test/classes/Engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -22,6 +22,7 @@ class MrgMyisamTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new MrgMyisam('mrg_myisam'); } diff --git a/test/classes/Engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php index 1ab9145aae..668777c551 100644 --- a/test/classes/Engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -24,6 +24,7 @@ class MyisamTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new Myisam('myisam'); } diff --git a/test/classes/Engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php index b723987614..1f65215904 100644 --- a/test/classes/Engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -22,6 +22,7 @@ class NdbclusterTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new Ndbcluster('nbdcluster'); } diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index 4881791135..28fa15b8fe 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -26,7 +26,7 @@ class PbxtTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); - + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new Pbxt('pbxt'); } diff --git a/test/classes/Engines/PerformanceSchemaTest.php b/test/classes/Engines/PerformanceSchemaTest.php index 8829cf4562..1f774a63da 100644 --- a/test/classes/Engines/PerformanceSchemaTest.php +++ b/test/classes/Engines/PerformanceSchemaTest.php @@ -22,6 +22,7 @@ class PerformanceSchemaTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $GLOBALS['server'] = 0; $this->object = new PerformanceSchema('PERFORMANCE_SCHEMA'); } diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index c540338ac6..c11f5b2abc 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -32,6 +32,8 @@ class ErrorHandlerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['lang'] = 'en'; + $GLOBALS['dbi'] = $this->createDatabaseInterface(); $this->object = new ErrorHandler(); $_SESSION['errors'] = []; $GLOBALS['server'] = 0; diff --git a/test/classes/GitTest.php b/test/classes/GitTest.php index 3b59841295..6847e3ab7b 100644 --- a/test/classes/GitTest.php +++ b/test/classes/GitTest.php @@ -427,4 +427,60 @@ class GitTest extends AbstractTestCase // Assert that the value is replaced by cached one $this->assertEquals($gitFolder, 'randomdir/.git'); } + + /** + * Test that we can extract values from Git objects + */ + public function testExtractDataFormTextBody(): void + { + $extractedData = $this->callFunction( + $this->object, + Git::class, + 'extractDataFormTextBody', + [ + [ + 'tree ed7fec263e1813887001855ddca9293479289180', + 'parent 90543399991cdb294185f90e8ae1a45e059c31ab', + 'author William Desportes <williamdes@wdes.fr> 1657717000 +0200', + 'committer William Desportes <williamdes@wdes.fr> 1657717000 +0200', + 'gpgsig -----BEGIN PGP SIGNATURE-----', + ' ', + ' iQIzBAABCgAdFiEExNkf3872tKPGU\/14kKDvG4JRqIkFAmLOwQgACgkQkKDvG4JR', + ' qIn8Kg\/+Os5e3bFLEtd3q\/w3e4IfvR64rdadA4IUugd4pJvGqJHleJNBQ8PNqwjR', + ' 9W0S9PQXAsul0XW5YtuLmBMGFFQDOab2ieix9CVA1w0D7quVQR8uLNb1Gln28NuS', + ' 6b24Q4cAQlp5uOoKT3ohRBUtGmu8SXF8Q\/5BwPY1AuL1LqY6w6EwSsInPXK1Yq3r', + ' RShxRXDhonKx3NqoCdRkWmAKkQrztWGGBI7mBG\/\/X0F4hSjsuwdpHBsl6yyri9p2', + ' bJbyAI+xQ+rBHb0iFIoLbxj6G1EkEmpISl+4980uef24SwMVk9ZOfH8cAgBZ62Mf', + ' xJ3f99ujhD9dvwCQivOwcEav+fPObiLC0EzfoqZgB7rTQdxUIu7WRpShZGwfuiEv', + ' sBmvQcnZptYHi0Kk78fdzISCQcPBgCw0gGcv+yLOE3HuQ24B+ncCusYdxyJQqMSc', + ' pm9vVHpwioufy5c7aBa05K7f2b1AhiZeVpT2t\/rboIYlIhQGY9uRNGX44Qtt6Oeb', + ' G6aU8O7gS5+Wsj00K+uSvUE\/znxx7Ad0zVuFQGUAhd3cDp9T09+FIr4TOE+3Z4Pk', + ' PlssVGVBdbaNaI0\/eV6fTa6B0hMH9mhmZhtHLXdsTw5xVySz7by5DZqZldydSFtk', + ' tVuUPxykK6F0qY79IPBH8Unx8egIlSzKWfP0JpRd+otemBnTKWg=', + ' =BVHc', + ' -----END PGP SIGNATURE-----', + '', + 'Remove ignore config.inc.php for psalm because it fails the CI', + '', + 'Signed-off-by: William Desportes <williamdes@wdes.fr>', + '', + ], + ] + ); + + $this->assertSame([ + [ + 'name' => 'William Desportes', + 'email' => 'williamdes@wdes.fr', + 'date' => '2022-07-13 12:56:40 +0200', + ], + [ + 'name' => 'William Desportes', + 'email' => 'williamdes@wdes.fr', + 'date' => '2022-07-13 12:56:40 +0200', + ], + 'Remove ignore config.inc.php for psalm because ' + . 'it fails the CI Signed-off-by: William Desportes <williamdes@wdes.fr>', + ], $extractedData); + } } diff --git a/test/classes/LanguageTest.php b/test/classes/LanguageTest.php index 363dd452ee..c07abae0ea 100644 --- a/test/classes/LanguageTest.php +++ b/test/classes/LanguageTest.php @@ -190,101 +190,33 @@ class LanguageTest extends AbstractTestCase /** * Data provider for language selection test. * - * @return array Test parameters. + * @return string[][] */ public function selectDataProvider(): array { return [ - [ - 'cs', - 'en', - '', - '', - '', - '', - '', - 'Czech', - ], - [ - '', - 'cs', - '', - '', - '', - '', - '', - 'Czech', - ], - [ - '', - 'cs', - 'en', - '', - '', - '', - '', - 'Czech', - ], - [ - '', - '', - 'cs', - '', - '', - '', - '', - 'Czech', - ], - [ - '', - '', - '', - 'cs', - '', - '', - '', - 'Czech', - ], - [ - '', - '', - '', - '', - 'cs,en-US;q=0.7,en;q=0.3', - '', - '', - 'Czech', - ], - [ - '', - '', - '', - '', - '', - 'Mozilla/5.0 (Linux; U; Android 2.2.2; tr-tr; GM FOX)', - '', - 'Turkish', - ], - [ - '', - '', - '', - '', - '', - '', - 'cs', - 'Czech', - ], - [ - '', - '', - '', - '', - '', - '', - '', - 'English', - ], + ['cs', 'en', '', '', '', '', '', 'Czech'], + ['', 'cs', '', '', '', '', '', 'Czech'], + ['', 'cs', 'en', '', '', '', '', 'Czech'], + ['', '', 'cs', '', '', '', '', 'Czech'], + ['', '', '', 'cs', '', '', '', 'Czech'], + ['', '', '', '', 'cs,en-US;q=0.7,en;q=0.3', '', '', 'Czech'], + ['', '', '', '', '', 'Mozilla/5.0 (Linux; U; Android 2.2.2; tr-tr; GM FOX)', '', 'Turkish'], + ['', '', '', '', '', '', 'cs', 'Czech'], + ['', '', '', '', '', '', '', 'English'], + ['', '', '', '', 'pt;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Portuguese'], + ['', '', '', '', 'pt-PT,pt;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Portuguese'], + ['', '', '', '', 'pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Portuguese (Brazil)'], + ['', '', '', '', 'ar;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Arabic'], + ['', '', '', '', 'ar-AE,ar;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Arabic'], + ['', '', '', '', 'ar-LY,ar;q=0.8,en-US;q=0.5,en;q=0.3', '', 'en', 'Arabic (Libya)'], + ['', '', '', '', 'en,pt;q=0.5', '', 'pt', 'English'], + ['', '', '', '', 'en-GB,en;q=0.7,pt;q=0.3', '', 'pt', 'English (United Kingdom)'], + ['', '', '', '', 'en-US,en;q=0.7,pt;q=0.3', '', 'pt', 'English'], + ['', '', '', '', 'zh,en;q=0.5', '', 'en', 'Chinese simplified'], + ['', '', '', '', 'zh-CN,zh;q=0.7,en;q=0.3', '', 'en', 'Chinese simplified'], + ['', '', '', '', 'zh-HK,zh;q=0.7,en;q=0.3', '', 'en', 'Chinese traditional'], + ['', '', '', '', 'zh-TW,zh;q=0.7,en;q=0.3', '', 'en', 'Chinese traditional'], ]; } |