1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 18:44:27 +02:00

Tweak of isCompatible method.

This commit is contained in:
Cameron
2021-02-13 06:15:42 -08:00
parent 0527993d98
commit 800f8734bf
4 changed files with 34 additions and 11 deletions

View File

@@ -1953,7 +1953,7 @@ class e107Test extends \Codeception\Test\Unit
public function testIsCompatible()
{
// version => expected
$tests = array (
$testPlugin = array (
'1' => false, // assumed incompatible.
'1.2.3' => false,
'1.2' => false,
@@ -1971,16 +1971,38 @@ class e107Test extends \Codeception\Test\Unit
);
$e107 = $this->e107;
// $ret = [];
foreach($tests as $input=>$expected)
foreach($testPlugin as $input=>$expected)
{
$result = $e107::isCompatible($input);
$result = $e107::isCompatible($input, 'plugin');
$this->assertSame($expected, $result);
}
$testTheme = array (
'1' => true, // assumed incompatible.
'1.2.3' => true,
'1.2' => true,
'2' => true, // assumed to work with all versions from 2+
'2.0' => true, // assumed to work with all versions from 2+
'2.3' => true, // assumed to work with all versions from 2.3 onward.
'2.1.0' => true,
'2.2.0' => true,
'2.3.0' => true,
'2.3.1' => true,
'1.7b' => true,
'2.9' => false,
'2.9.2' => false,
'3' => false,
);
foreach($testTheme as $input=>$expected)
{
$result = $e107::isCompatible($input, 'theme');
$this->assertSame($expected, $result);
// $ret[$input] = $result;
}
}
/*
public function testIni_set()