mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
php cs autofix
This commit is contained in:
parent
9f3730c11c
commit
a559cb4e2e
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
- name: Setup Composer
|
||||
run: composer install
|
||||
- name: Autoformat
|
||||
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_ordered_covers": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"this": "self"}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline_array": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
|
||||
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "binary_operator_spaces": {"operators": {"=": "align", ".=": "align", "+=": "align", "-=": "align", "*=": "align", "/=": "align", "|=": "align", "&=": "align", "=>": "align", "??=": "align"}}, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_ordered_covers": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"this": "self"}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline_array": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
|
||||
- name: Check for modified files
|
||||
id: git-check
|
||||
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ final class ArticleCorrelationAffinity
|
|||
// create the affinity table
|
||||
foreach ($possibleItems as $item1) {
|
||||
foreach ($possibleItems as $item2) {
|
||||
if ($item1 !== $item2 &&!isset($this->affinity[$item1][$item2]) && !isset($this->affinity[$item2][$item1])) {
|
||||
if ($item1 !== $item2 && !isset($this->affinity[$item1][$item2]) && !isset($this->affinity[$item2][$item1])) {
|
||||
$this->affinity[$item1][$item2] = Correlation::bravaisPersonCorrelationCoefficientPopulation($this->items[$item1], $this->items[$item2]);
|
||||
$this->affinity[$item2][$item1] = $this->affinity[$item1][$item2];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ abstract class ConnectionAbstract implements ConnectionInterface
|
|||
*/
|
||||
public function close() : void
|
||||
{
|
||||
$this->con = null;
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::CLOSED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ final class MysqlConnection extends ConnectionAbstract
|
|||
|
||||
$this->status = DatabaseStatus::OK;
|
||||
} catch (\PDOException $e) {
|
||||
$this->con = null;
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::MISSING_DATABASE;
|
||||
} finally {
|
||||
$this->dbdata['password'] = '****';
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ final class PostgresConnection extends ConnectionAbstract
|
|||
|
||||
$this->status = DatabaseStatus::OK;
|
||||
} catch (\PDOException $e) {
|
||||
$this->con = null;
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::MISSING_DATABASE;
|
||||
throw new InvalidConnectionConfigException((string) \json_encode($this->dbdata));
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ final class SQLiteConnection extends ConnectionAbstract
|
|||
|
||||
$this->status = DatabaseStatus::OK;
|
||||
} catch (\PDOException $e) {
|
||||
$this->con = null;
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::MISSING_DATABASE;
|
||||
} finally {
|
||||
$this->dbdata['password'] = '****';
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ final class SqlServerConnection extends ConnectionAbstract
|
|||
|
||||
$this->status = DatabaseStatus::OK;
|
||||
} catch (\PDOException $e) {
|
||||
$this->con = null;
|
||||
$this->con = null;
|
||||
$this->status = DatabaseStatus::MISSING_DATABASE;
|
||||
} finally {
|
||||
$this->dbdata['password'] = '****';
|
||||
|
|
|
|||
|
|
@ -1114,7 +1114,7 @@ class Builder extends BuilderAbstract
|
|||
*/
|
||||
public function join($table, string $type = JoinType::JOIN, string $alias = null) : self
|
||||
{
|
||||
if (!\is_string($table)&& !($table instanceof self)) {
|
||||
if (!\is_string($table) && !($table instanceof self)) {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ final class ChiSquaredDistribution
|
|||
|
||||
return [
|
||||
'Chi2' => $sum,
|
||||
'P' => $p,
|
||||
'H0' => ($p > $significance),
|
||||
'df' => $df,
|
||||
'P' => $p,
|
||||
'H0' => ($p > $significance),
|
||||
'df' => $df,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,40 +33,40 @@ final class TDistribution
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const TABLE = [
|
||||
1 => ['0' => 0.000, '0.5' => 1.000, '0.6' => 1.376, '0.7' => 1.963, '0.8' => 3.078, '0.9' => 6.314, '0.95' => 12.71, '0.98' => 31.82, '0.99' => 63.66, '0.998' => 318.31, '0.999' => 636.62,],
|
||||
2 => ['0' => 0.000, '0.5' => 0.816, '0.6' => 1.061, '0.7' => 1.386, '0.8' => 1.886, '0.9' => 2.920, '0.95' => 4.303, '0.98' => 6.965, '0.99' => 9.925, '0.998' => 22.327, '0.999' => 31.599,],
|
||||
3 => ['0' => 0.000, '0.5' => 0.765, '0.6' => 0.978, '0.7' => 1.250, '0.8' => 1.638, '0.9' => 2.353, '0.95' => 3.182, '0.98' => 4.541, '0.99' => 5.841, '0.998' => 10.215, '0.999' => 12.924,],
|
||||
4 => ['0' => 0.000, '0.5' => 0.741, '0.6' => 0.941, '0.7' => 1.190, '0.8' => 1.533, '0.9' => 2.132, '0.95' => 2.776, '0.98' => 3.747, '0.99' => 4.604, '0.998' => 7.173, '0.999' => 8.610,],
|
||||
5 => ['0' => 0.000, '0.5' => 0.727, '0.6' => 0.920, '0.7' => 1.156, '0.8' => 1.476, '0.9' => 2.015, '0.95' => 2.571, '0.98' => 3.365, '0.99' => 4.032, '0.998' => 5.893, '0.999' => 6.869,],
|
||||
6 => ['0' => 0.000, '0.5' => 0.718, '0.6' => 0.906, '0.7' => 1.134, '0.8' => 1.440, '0.9' => 1.943, '0.95' => 2.447, '0.98' => 3.143, '0.99' => 3.707, '0.998' => 5.208, '0.999' => 5.959,],
|
||||
7 => ['0' => 0.000, '0.5' => 0.711, '0.6' => 0.896, '0.7' => 1.119, '0.8' => 1.415, '0.9' => 1.895, '0.95' => 2.365, '0.98' => 2.998, '0.99' => 3.499, '0.998' => 4.785, '0.999' => 5.408,],
|
||||
8 => ['0' => 0.000, '0.5' => 0.706, '0.6' => 0.889, '0.7' => 1.108, '0.8' => 1.397, '0.9' => 1.860, '0.95' => 2.306, '0.98' => 2.896, '0.99' => 3.355, '0.998' => 4.501, '0.999' => 5.041,],
|
||||
9 => ['0' => 0.000, '0.5' => 0.703, '0.6' => 0.883, '0.7' => 1.100, '0.8' => 1.383, '0.9' => 1.833, '0.95' => 2.262, '0.98' => 2.821, '0.99' => 3.250, '0.998' => 4.297, '0.999' => 4.781,],
|
||||
10 => ['0' => 0.000, '0.5' => 0.700, '0.6' => 0.879, '0.7' => 1.093, '0.8' => 1.372, '0.9' => 1.812, '0.95' => 2.228, '0.98' => 2.764, '0.99' => 3.169, '0.998' => 4.144, '0.999' => 4.587,],
|
||||
11 => ['0' => 0.000, '0.5' => 0.697, '0.6' => 0.876, '0.7' => 1.088, '0.8' => 1.363, '0.9' => 1.796, '0.95' => 2.201, '0.98' => 2.718, '0.99' => 3.106, '0.998' => 4.025, '0.999' => 4.437,],
|
||||
12 => ['0' => 0.000, '0.5' => 0.695, '0.6' => 0.873, '0.7' => 1.083, '0.8' => 1.356, '0.9' => 1.782, '0.95' => 2.179, '0.98' => 2.681, '0.99' => 3.055, '0.998' => 3.930, '0.999' => 4.318,],
|
||||
13 => ['0' => 0.000, '0.5' => 0.694, '0.6' => 0.870, '0.7' => 1.079, '0.8' => 1.350, '0.9' => 1.771, '0.95' => 2.160, '0.98' => 2.650, '0.99' => 3.012, '0.998' => 3.852, '0.999' => 4.221,],
|
||||
14 => ['0' => 0.000, '0.5' => 0.692, '0.6' => 0.868, '0.7' => 1.076, '0.8' => 1.345, '0.9' => 1.761, '0.95' => 2.145, '0.98' => 2.624, '0.99' => 2.977, '0.998' => 3.787, '0.999' => 4.140,],
|
||||
15 => ['0' => 0.000, '0.5' => 0.691, '0.6' => 0.866, '0.7' => 1.074, '0.8' => 1.341, '0.9' => 1.753, '0.95' => 2.131, '0.98' => 2.602, '0.99' => 2.947, '0.998' => 3.733, '0.999' => 4.073,],
|
||||
16 => ['0' => 0.000, '0.5' => 0.690, '0.6' => 0.865, '0.7' => 1.071, '0.8' => 1.337, '0.9' => 1.746, '0.95' => 2.120, '0.98' => 2.583, '0.99' => 2.921, '0.998' => 3.686, '0.999' => 4.015,],
|
||||
17 => ['0' => 0.000, '0.5' => 0.689, '0.6' => 0.863, '0.7' => 1.069, '0.8' => 1.333, '0.9' => 1.740, '0.95' => 2.110, '0.98' => 2.567, '0.99' => 2.898, '0.998' => 3.646, '0.999' => 3.965,],
|
||||
18 => ['0' => 0.000, '0.5' => 0.688, '0.6' => 0.862, '0.7' => 1.067, '0.8' => 1.330, '0.9' => 1.734, '0.95' => 2.101, '0.98' => 2.552, '0.99' => 2.878, '0.998' => 3.610, '0.999' => 3.922,],
|
||||
19 => ['0' => 0.000, '0.5' => 0.688, '0.6' => 0.861, '0.7' => 1.066, '0.8' => 1.328, '0.9' => 1.729, '0.95' => 2.093, '0.98' => 2.539, '0.99' => 2.861, '0.998' => 3.579, '0.999' => 3.883,],
|
||||
20 => ['0' => 0.000, '0.5' => 0.687, '0.6' => 0.860, '0.7' => 1.064, '0.8' => 1.325, '0.9' => 1.725, '0.95' => 2.086, '0.98' => 2.528, '0.99' => 2.845, '0.998' => 3.552, '0.999' => 3.850,],
|
||||
21 => ['0' => 0.000, '0.5' => 0.686, '0.6' => 0.859, '0.7' => 1.063, '0.8' => 1.323, '0.9' => 1.721, '0.95' => 2.080, '0.98' => 2.518, '0.99' => 2.831, '0.998' => 3.527, '0.999' => 3.819,],
|
||||
22 => ['0' => 0.000, '0.5' => 0.686, '0.6' => 0.858, '0.7' => 1.061, '0.8' => 1.321, '0.9' => 1.717, '0.95' => 2.074, '0.98' => 2.508, '0.99' => 2.819, '0.998' => 3.505, '0.999' => 3.792,],
|
||||
23 => ['0' => 0.000, '0.5' => 0.685, '0.6' => 0.858, '0.7' => 1.060, '0.8' => 1.319, '0.9' => 1.714, '0.95' => 2.069, '0.98' => 2.500, '0.99' => 2.807, '0.998' => 3.485, '0.999' => 3.768,],
|
||||
24 => ['0' => 0.000, '0.5' => 0.685, '0.6' => 0.857, '0.7' => 1.059, '0.8' => 1.318, '0.9' => 1.711, '0.95' => 2.064, '0.98' => 2.492, '0.99' => 2.797, '0.998' => 3.467, '0.999' => 3.745,],
|
||||
25 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.856, '0.7' => 1.058, '0.8' => 1.316, '0.9' => 1.708, '0.95' => 2.060, '0.98' => 2.485, '0.99' => 2.787, '0.998' => 3.450, '0.999' => 3.725,],
|
||||
26 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.856, '0.7' => 1.058, '0.8' => 1.315, '0.9' => 1.706, '0.95' => 2.056, '0.98' => 2.479, '0.99' => 2.779, '0.998' => 3.435, '0.999' => 3.707,],
|
||||
27 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.855, '0.7' => 1.057, '0.8' => 1.314, '0.9' => 1.703, '0.95' => 2.052, '0.98' => 2.473, '0.99' => 2.771, '0.998' => 3.421, '0.999' => 3.690,],
|
||||
28 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.855, '0.7' => 1.056, '0.8' => 1.313, '0.9' => 1.701, '0.95' => 2.048, '0.98' => 2.467, '0.99' => 2.763, '0.998' => 3.408, '0.999' => 3.674,],
|
||||
29 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.854, '0.7' => 1.055, '0.8' => 1.311, '0.9' => 1.699, '0.95' => 2.045, '0.98' => 2.462, '0.99' => 2.756, '0.998' => 3.396, '0.999' => 3.659,],
|
||||
30 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.854, '0.7' => 1.055, '0.8' => 1.310, '0.9' => 1.697, '0.95' => 2.042, '0.98' => 2.457, '0.99' => 2.750, '0.998' => 3.385, '0.999' => 3.646,],
|
||||
40 => ['0' => 0.000, '0.5' => 0.681, '0.6' => 0.851, '0.7' => 1.050, '0.8' => 1.303, '0.9' => 1.684, '0.95' => 2.021, '0.98' => 2.423, '0.99' => 2.704, '0.998' => 3.307, '0.999' => 3.551,],
|
||||
60 => ['0' => 0.000, '0.5' => 0.679, '0.6' => 0.848, '0.7' => 1.045, '0.8' => 1.296, '0.9' => 1.671, '0.95' => 2.000, '0.98' => 2.390, '0.99' => 2.660, '0.998' => 3.232, '0.999' => 3.460,],
|
||||
80 => ['0' => 0.000, '0.5' => 0.678, '0.6' => 0.846, '0.7' => 1.043, '0.8' => 1.292, '0.9' => 1.664, '0.95' => 1.990, '0.98' => 2.374, '0.99' => 2.639, '0.998' => 3.195, '0.999' => 3.416,],
|
||||
100 => ['0' => 0.000, '0.5' => 0.677, '0.6' => 0.845, '0.7' => 1.042, '0.8' => 1.290, '0.9' => 1.660, '0.95' => 1.984, '0.98' => 2.364, '0.99' => 2.626, '0.998' => 3.174, '0.999' => 3.390,],
|
||||
1 => ['0' => 0.000, '0.5' => 1.000, '0.6' => 1.376, '0.7' => 1.963, '0.8' => 3.078, '0.9' => 6.314, '0.95' => 12.71, '0.98' => 31.82, '0.99' => 63.66, '0.998' => 318.31, '0.999' => 636.62,],
|
||||
2 => ['0' => 0.000, '0.5' => 0.816, '0.6' => 1.061, '0.7' => 1.386, '0.8' => 1.886, '0.9' => 2.920, '0.95' => 4.303, '0.98' => 6.965, '0.99' => 9.925, '0.998' => 22.327, '0.999' => 31.599,],
|
||||
3 => ['0' => 0.000, '0.5' => 0.765, '0.6' => 0.978, '0.7' => 1.250, '0.8' => 1.638, '0.9' => 2.353, '0.95' => 3.182, '0.98' => 4.541, '0.99' => 5.841, '0.998' => 10.215, '0.999' => 12.924,],
|
||||
4 => ['0' => 0.000, '0.5' => 0.741, '0.6' => 0.941, '0.7' => 1.190, '0.8' => 1.533, '0.9' => 2.132, '0.95' => 2.776, '0.98' => 3.747, '0.99' => 4.604, '0.998' => 7.173, '0.999' => 8.610,],
|
||||
5 => ['0' => 0.000, '0.5' => 0.727, '0.6' => 0.920, '0.7' => 1.156, '0.8' => 1.476, '0.9' => 2.015, '0.95' => 2.571, '0.98' => 3.365, '0.99' => 4.032, '0.998' => 5.893, '0.999' => 6.869,],
|
||||
6 => ['0' => 0.000, '0.5' => 0.718, '0.6' => 0.906, '0.7' => 1.134, '0.8' => 1.440, '0.9' => 1.943, '0.95' => 2.447, '0.98' => 3.143, '0.99' => 3.707, '0.998' => 5.208, '0.999' => 5.959,],
|
||||
7 => ['0' => 0.000, '0.5' => 0.711, '0.6' => 0.896, '0.7' => 1.119, '0.8' => 1.415, '0.9' => 1.895, '0.95' => 2.365, '0.98' => 2.998, '0.99' => 3.499, '0.998' => 4.785, '0.999' => 5.408,],
|
||||
8 => ['0' => 0.000, '0.5' => 0.706, '0.6' => 0.889, '0.7' => 1.108, '0.8' => 1.397, '0.9' => 1.860, '0.95' => 2.306, '0.98' => 2.896, '0.99' => 3.355, '0.998' => 4.501, '0.999' => 5.041,],
|
||||
9 => ['0' => 0.000, '0.5' => 0.703, '0.6' => 0.883, '0.7' => 1.100, '0.8' => 1.383, '0.9' => 1.833, '0.95' => 2.262, '0.98' => 2.821, '0.99' => 3.250, '0.998' => 4.297, '0.999' => 4.781,],
|
||||
10 => ['0' => 0.000, '0.5' => 0.700, '0.6' => 0.879, '0.7' => 1.093, '0.8' => 1.372, '0.9' => 1.812, '0.95' => 2.228, '0.98' => 2.764, '0.99' => 3.169, '0.998' => 4.144, '0.999' => 4.587,],
|
||||
11 => ['0' => 0.000, '0.5' => 0.697, '0.6' => 0.876, '0.7' => 1.088, '0.8' => 1.363, '0.9' => 1.796, '0.95' => 2.201, '0.98' => 2.718, '0.99' => 3.106, '0.998' => 4.025, '0.999' => 4.437,],
|
||||
12 => ['0' => 0.000, '0.5' => 0.695, '0.6' => 0.873, '0.7' => 1.083, '0.8' => 1.356, '0.9' => 1.782, '0.95' => 2.179, '0.98' => 2.681, '0.99' => 3.055, '0.998' => 3.930, '0.999' => 4.318,],
|
||||
13 => ['0' => 0.000, '0.5' => 0.694, '0.6' => 0.870, '0.7' => 1.079, '0.8' => 1.350, '0.9' => 1.771, '0.95' => 2.160, '0.98' => 2.650, '0.99' => 3.012, '0.998' => 3.852, '0.999' => 4.221,],
|
||||
14 => ['0' => 0.000, '0.5' => 0.692, '0.6' => 0.868, '0.7' => 1.076, '0.8' => 1.345, '0.9' => 1.761, '0.95' => 2.145, '0.98' => 2.624, '0.99' => 2.977, '0.998' => 3.787, '0.999' => 4.140,],
|
||||
15 => ['0' => 0.000, '0.5' => 0.691, '0.6' => 0.866, '0.7' => 1.074, '0.8' => 1.341, '0.9' => 1.753, '0.95' => 2.131, '0.98' => 2.602, '0.99' => 2.947, '0.998' => 3.733, '0.999' => 4.073,],
|
||||
16 => ['0' => 0.000, '0.5' => 0.690, '0.6' => 0.865, '0.7' => 1.071, '0.8' => 1.337, '0.9' => 1.746, '0.95' => 2.120, '0.98' => 2.583, '0.99' => 2.921, '0.998' => 3.686, '0.999' => 4.015,],
|
||||
17 => ['0' => 0.000, '0.5' => 0.689, '0.6' => 0.863, '0.7' => 1.069, '0.8' => 1.333, '0.9' => 1.740, '0.95' => 2.110, '0.98' => 2.567, '0.99' => 2.898, '0.998' => 3.646, '0.999' => 3.965,],
|
||||
18 => ['0' => 0.000, '0.5' => 0.688, '0.6' => 0.862, '0.7' => 1.067, '0.8' => 1.330, '0.9' => 1.734, '0.95' => 2.101, '0.98' => 2.552, '0.99' => 2.878, '0.998' => 3.610, '0.999' => 3.922,],
|
||||
19 => ['0' => 0.000, '0.5' => 0.688, '0.6' => 0.861, '0.7' => 1.066, '0.8' => 1.328, '0.9' => 1.729, '0.95' => 2.093, '0.98' => 2.539, '0.99' => 2.861, '0.998' => 3.579, '0.999' => 3.883,],
|
||||
20 => ['0' => 0.000, '0.5' => 0.687, '0.6' => 0.860, '0.7' => 1.064, '0.8' => 1.325, '0.9' => 1.725, '0.95' => 2.086, '0.98' => 2.528, '0.99' => 2.845, '0.998' => 3.552, '0.999' => 3.850,],
|
||||
21 => ['0' => 0.000, '0.5' => 0.686, '0.6' => 0.859, '0.7' => 1.063, '0.8' => 1.323, '0.9' => 1.721, '0.95' => 2.080, '0.98' => 2.518, '0.99' => 2.831, '0.998' => 3.527, '0.999' => 3.819,],
|
||||
22 => ['0' => 0.000, '0.5' => 0.686, '0.6' => 0.858, '0.7' => 1.061, '0.8' => 1.321, '0.9' => 1.717, '0.95' => 2.074, '0.98' => 2.508, '0.99' => 2.819, '0.998' => 3.505, '0.999' => 3.792,],
|
||||
23 => ['0' => 0.000, '0.5' => 0.685, '0.6' => 0.858, '0.7' => 1.060, '0.8' => 1.319, '0.9' => 1.714, '0.95' => 2.069, '0.98' => 2.500, '0.99' => 2.807, '0.998' => 3.485, '0.999' => 3.768,],
|
||||
24 => ['0' => 0.000, '0.5' => 0.685, '0.6' => 0.857, '0.7' => 1.059, '0.8' => 1.318, '0.9' => 1.711, '0.95' => 2.064, '0.98' => 2.492, '0.99' => 2.797, '0.998' => 3.467, '0.999' => 3.745,],
|
||||
25 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.856, '0.7' => 1.058, '0.8' => 1.316, '0.9' => 1.708, '0.95' => 2.060, '0.98' => 2.485, '0.99' => 2.787, '0.998' => 3.450, '0.999' => 3.725,],
|
||||
26 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.856, '0.7' => 1.058, '0.8' => 1.315, '0.9' => 1.706, '0.95' => 2.056, '0.98' => 2.479, '0.99' => 2.779, '0.998' => 3.435, '0.999' => 3.707,],
|
||||
27 => ['0' => 0.000, '0.5' => 0.684, '0.6' => 0.855, '0.7' => 1.057, '0.8' => 1.314, '0.9' => 1.703, '0.95' => 2.052, '0.98' => 2.473, '0.99' => 2.771, '0.998' => 3.421, '0.999' => 3.690,],
|
||||
28 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.855, '0.7' => 1.056, '0.8' => 1.313, '0.9' => 1.701, '0.95' => 2.048, '0.98' => 2.467, '0.99' => 2.763, '0.998' => 3.408, '0.999' => 3.674,],
|
||||
29 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.854, '0.7' => 1.055, '0.8' => 1.311, '0.9' => 1.699, '0.95' => 2.045, '0.98' => 2.462, '0.99' => 2.756, '0.998' => 3.396, '0.999' => 3.659,],
|
||||
30 => ['0' => 0.000, '0.5' => 0.683, '0.6' => 0.854, '0.7' => 1.055, '0.8' => 1.310, '0.9' => 1.697, '0.95' => 2.042, '0.98' => 2.457, '0.99' => 2.750, '0.998' => 3.385, '0.999' => 3.646,],
|
||||
40 => ['0' => 0.000, '0.5' => 0.681, '0.6' => 0.851, '0.7' => 1.050, '0.8' => 1.303, '0.9' => 1.684, '0.95' => 2.021, '0.98' => 2.423, '0.99' => 2.704, '0.998' => 3.307, '0.999' => 3.551,],
|
||||
60 => ['0' => 0.000, '0.5' => 0.679, '0.6' => 0.848, '0.7' => 1.045, '0.8' => 1.296, '0.9' => 1.671, '0.95' => 2.000, '0.98' => 2.390, '0.99' => 2.660, '0.998' => 3.232, '0.999' => 3.460,],
|
||||
80 => ['0' => 0.000, '0.5' => 0.678, '0.6' => 0.846, '0.7' => 1.043, '0.8' => 1.292, '0.9' => 1.664, '0.95' => 1.990, '0.98' => 2.374, '0.99' => 2.639, '0.998' => 3.195, '0.999' => 3.416,],
|
||||
100 => ['0' => 0.000, '0.5' => 0.677, '0.6' => 0.845, '0.7' => 1.042, '0.8' => 1.290, '0.9' => 1.660, '0.95' => 1.984, '0.98' => 2.364, '0.99' => 2.626, '0.998' => 3.174, '0.999' => 3.390,],
|
||||
1000 => ['0' => 0.000, '0.5' => 0.675, '0.6' => 0.842, '0.7' => 1.037, '0.8' => 1.282, '0.9' => 1.646, '0.95' => 1.962, '0.98' => 2.330, '0.99' => 2.581, '0.998' => 3.098, '0.999' => 3.300,],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1387,7 +1387,7 @@ class Mail
|
|||
public function preSend() : void
|
||||
{
|
||||
$this->mimeHeader = '';
|
||||
$this->mimeBody = $this->createBody();
|
||||
$this->mimeBody = $this->createBody();
|
||||
// @todo: only if createBody impements sign / #tempheader = $this->header
|
||||
$this->mimeHeader = $this->createHeader();
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ final class Numeric
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const ROMANS = [
|
||||
'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100,
|
||||
'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100,
|
||||
'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10,
|
||||
'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -153,17 +153,17 @@ class Markdown
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $inlineTypes = [
|
||||
'"' => ['SpecialCharacter'],
|
||||
'!' => ['Image'],
|
||||
'&' => ['SpecialCharacter'],
|
||||
'*' => ['Emphasis'],
|
||||
':' => ['Url'],
|
||||
'<' => ['UrlTag', 'EmailTag', 'SpecialCharacter'],
|
||||
'>' => ['SpecialCharacter'],
|
||||
'[' => ['Link'],
|
||||
'_' => ['Emphasis'],
|
||||
'`' => ['Code'],
|
||||
'~' => ['Strikethrough'],
|
||||
'"' => ['SpecialCharacter'],
|
||||
'!' => ['Image'],
|
||||
'&' => ['SpecialCharacter'],
|
||||
'*' => ['Emphasis'],
|
||||
':' => ['Url'],
|
||||
'<' => ['UrlTag', 'EmailTag', 'SpecialCharacter'],
|
||||
'>' => ['SpecialCharacter'],
|
||||
'[' => ['Link'],
|
||||
'_' => ['Emphasis'],
|
||||
'`' => ['Code'],
|
||||
'~' => ['Strikethrough'],
|
||||
'\\' => ['EscapeSequence'],
|
||||
];
|
||||
|
||||
|
|
@ -376,9 +376,9 @@ class Markdown
|
|||
|
||||
return [
|
||||
'element' => [
|
||||
'name' => 'pre',
|
||||
'name' => 'pre',
|
||||
'handler' => 'element',
|
||||
'text' => [
|
||||
'text' => [
|
||||
'name' => 'code',
|
||||
'text' => \substr($lineArray['body'], 4),
|
||||
],
|
||||
|
|
@ -455,11 +455,11 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'char' => $lineArray['text'][0],
|
||||
'char' => $lineArray['text'][0],
|
||||
'element' => [
|
||||
'name' => 'pre',
|
||||
'name' => 'pre',
|
||||
'handler' => 'element',
|
||||
'text' => $elementArray,
|
||||
'text' => $elementArray,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -538,8 +538,8 @@ class Markdown
|
|||
|
||||
return [
|
||||
'element' => [
|
||||
'name' => 'h' . \min(6, $level),
|
||||
'text' => \trim($lineArray['text'], '# '),
|
||||
'name' => 'h' . \min(6, $level),
|
||||
'text' => \trim($lineArray['text'], '# '),
|
||||
'handler' => 'line',
|
||||
],
|
||||
];
|
||||
|
|
@ -563,10 +563,10 @@ class Markdown
|
|||
}
|
||||
|
||||
$block = [
|
||||
'indent' => $lineArray['indent'],
|
||||
'indent' => $lineArray['indent'],
|
||||
'pattern' => $pattern,
|
||||
'element' => [
|
||||
'name' => $name,
|
||||
'name' => $name,
|
||||
'handler' => 'elements',
|
||||
],
|
||||
];
|
||||
|
|
@ -580,9 +580,9 @@ class Markdown
|
|||
}
|
||||
|
||||
$block['li'] = [
|
||||
'name' => 'li',
|
||||
'name' => 'li',
|
||||
'handler' => 'li',
|
||||
'text' => [
|
||||
'text' => [
|
||||
$matches[2],
|
||||
],
|
||||
];
|
||||
|
|
@ -614,9 +614,9 @@ class Markdown
|
|||
unset($block['li']);
|
||||
|
||||
$block['li'] = [
|
||||
'name' => 'li',
|
||||
'name' => 'li',
|
||||
'handler' => 'li',
|
||||
'text' => [
|
||||
'text' => [
|
||||
isset($matches[1]) ? $matches[1] : '',
|
||||
],
|
||||
];
|
||||
|
|
@ -665,9 +665,9 @@ class Markdown
|
|||
|
||||
return [
|
||||
'element' => [
|
||||
'name' => 'blockquote',
|
||||
'name' => 'blockquote',
|
||||
'handler' => 'lines',
|
||||
'text' => (array) $matches[1],
|
||||
'text' => (array) $matches[1],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -768,7 +768,7 @@ class Markdown
|
|||
}
|
||||
|
||||
$data = [
|
||||
'url' => UriFactory::build($matches[2]),
|
||||
'url' => UriFactory::build($matches[2]),
|
||||
'title' => $matches[3] ?? null,
|
||||
];
|
||||
|
||||
|
|
@ -828,8 +828,8 @@ class Markdown
|
|||
|
||||
foreach ($headerCells as $index => $headerCell) {
|
||||
$headerElement = [
|
||||
'name' => 'th',
|
||||
'text' => \trim($headerCell),
|
||||
'name' => 'th',
|
||||
'text' => \trim($headerCell),
|
||||
'handler' => 'line',
|
||||
];
|
||||
|
||||
|
|
@ -845,27 +845,27 @@ class Markdown
|
|||
$block = [
|
||||
'alignments' => $alignments,
|
||||
'identified' => true,
|
||||
'element' => [
|
||||
'name' => 'table',
|
||||
'element' => [
|
||||
'name' => 'table',
|
||||
'handler' => 'elements',
|
||||
],
|
||||
];
|
||||
|
||||
$block['element']['text'][] = [
|
||||
'name' => 'thead',
|
||||
'name' => 'thead',
|
||||
'handler' => 'elements',
|
||||
];
|
||||
|
||||
$block['element']['text'][] = [
|
||||
'name' => 'tbody',
|
||||
'name' => 'tbody',
|
||||
'handler' => 'elements',
|
||||
'text' => [],
|
||||
'text' => [],
|
||||
];
|
||||
|
||||
$block['element']['text'][0]['text'][] = [
|
||||
'name' => 'tr',
|
||||
'name' => 'tr',
|
||||
'handler' => 'elements',
|
||||
'text' => $headerElements,
|
||||
'text' => $headerElements,
|
||||
];
|
||||
|
||||
return $block;
|
||||
|
|
@ -900,9 +900,9 @@ class Markdown
|
|||
|
||||
foreach ($matches[0] as $index => $cell) {
|
||||
$element = [
|
||||
'name' => 'td',
|
||||
'name' => 'td',
|
||||
'handler' => 'line',
|
||||
'text' => \trim($cell),
|
||||
'text' => \trim($cell),
|
||||
];
|
||||
|
||||
if (isset($block['alignments'][$index])) {
|
||||
|
|
@ -915,9 +915,9 @@ class Markdown
|
|||
}
|
||||
|
||||
$block['element']['text'][1]['text'][] = [
|
||||
'name' => 'tr',
|
||||
'name' => 'tr',
|
||||
'handler' => 'elements',
|
||||
'text' => $elements,
|
||||
'text' => $elements,
|
||||
];
|
||||
|
||||
return $block;
|
||||
|
|
@ -937,8 +937,8 @@ class Markdown
|
|||
{
|
||||
return [
|
||||
'element' => [
|
||||
'name' => 'p',
|
||||
'text' => $lineArray['text'],
|
||||
'name' => 'p',
|
||||
'text' => $lineArray['text'],
|
||||
'handler' => 'line',
|
||||
],
|
||||
];
|
||||
|
|
@ -1013,7 +1013,7 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => 'code',
|
||||
'text' => \preg_replace("/[ ]*\n/", ' ', $matches[2]),
|
||||
|
|
@ -1043,10 +1043,10 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => 'a',
|
||||
'text' => $matches[1],
|
||||
'name' => 'a',
|
||||
'text' => $matches[1],
|
||||
'attributes' => [
|
||||
'href' => UriFactory::build($url),
|
||||
],
|
||||
|
|
@ -1082,11 +1082,11 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => $emphasis,
|
||||
'name' => $emphasis,
|
||||
'handler' => 'line',
|
||||
'text' => $matches[1],
|
||||
'text' => $matches[1],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -1135,9 +1135,9 @@ class Markdown
|
|||
}
|
||||
|
||||
$inline = [
|
||||
'extent' => $link['extent'] + 1,
|
||||
'extent' => $link['extent'] + 1,
|
||||
'element' => [
|
||||
'name' => 'img',
|
||||
'name' => 'img',
|
||||
'attributes' => [
|
||||
'src' => UriFactory::build($link['element']['attributes']['href']),
|
||||
'alt' => $link['element']['text'],
|
||||
|
|
@ -1164,11 +1164,11 @@ class Markdown
|
|||
protected static function inlineLink(array $excerpt) : ?array
|
||||
{
|
||||
$element = [
|
||||
'name' => 'a',
|
||||
'handler' => 'line',
|
||||
'text' => null,
|
||||
'name' => 'a',
|
||||
'handler' => 'line',
|
||||
'text' => null,
|
||||
'attributes' => [
|
||||
'href' => null,
|
||||
'href' => null,
|
||||
'title' => null,
|
||||
],
|
||||
];
|
||||
|
|
@ -1213,7 +1213,7 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => $extent,
|
||||
'extent' => $extent,
|
||||
'element' => $element,
|
||||
];
|
||||
}
|
||||
|
|
@ -1266,10 +1266,10 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => 'del',
|
||||
'text' => $matches[1],
|
||||
'name' => 'del',
|
||||
'text' => $matches[1],
|
||||
'handler' => 'line',
|
||||
],
|
||||
];
|
||||
|
|
@ -1295,11 +1295,11 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0][0]),
|
||||
'extent' => \strlen($matches[0][0]),
|
||||
'position' => $matches[0][1],
|
||||
'element' => [
|
||||
'name' => 'a',
|
||||
'text' => $matches[0][0],
|
||||
'element' => [
|
||||
'name' => 'a',
|
||||
'text' => $matches[0][0],
|
||||
'attributes' => [
|
||||
'href' => UriFactory::build($matches[0][0]),
|
||||
],
|
||||
|
|
@ -1323,10 +1323,10 @@ class Markdown
|
|||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => 'a',
|
||||
'text' => $matches[1],
|
||||
'name' => 'a',
|
||||
'text' => $matches[1],
|
||||
'attributes' => [
|
||||
'href' => UriFactory::build($matches[1]),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ class Name
|
|||
],
|
||||
'asian' => [
|
||||
'female' => ['none'],
|
||||
'male' => ['none'],
|
||||
'male' => ['none'],
|
||||
'family' => [
|
||||
'Հովհաննիսյան', 'Հարությունյան', 'Սարգսյան', 'Խաչատրյան', 'Գրիգորյան', 'আহমেদ', 'আলী', 'আক্তার',
|
||||
'বন্দ্যোপাধ্যায়', 'নিক', 'ব্যাপারী', 'বড়ুয়া', 'বিশ্বাস', 'ভৌমিক', 'বসু', '王', '李', '张', '刘', '陈', '杨',
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class IntroSortTest extends \PHPUnit\Framework\TestCase
|
|||
];
|
||||
|
||||
$newList = IntroSort::sort($list);
|
||||
$result = [];
|
||||
$result = [];
|
||||
foreach ($newList as $element) {
|
||||
$result[] = $element->value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class TimSortTest extends \PHPUnit\Framework\TestCase
|
|||
];
|
||||
|
||||
$newList = TimSort::sort($list);
|
||||
$result = [];
|
||||
$result = [];
|
||||
foreach ($newList as $element) {
|
||||
$result[] = $element->value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class ApplicationInfoTest extends \PHPUnit\Framework\TestCase
|
|||
$info = new ApplicationInfo(__DIR__ . '/info-test.json');
|
||||
$info->load();
|
||||
|
||||
$testObj = new class() {
|
||||
$testObj = new class() {
|
||||
public $test = 1;
|
||||
|
||||
public function test() : void
|
||||
|
|
|
|||
|
|
@ -235,17 +235,17 @@ $CONFIG = [
|
|||
],
|
||||
'mail' => [
|
||||
'imap' => [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 143,
|
||||
'ssl' => false,
|
||||
'user' => 'test',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 143,
|
||||
'ssl' => false,
|
||||
'user' => 'test',
|
||||
'password' => '123456',
|
||||
],
|
||||
'pop3' => [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 25,
|
||||
'ssl' => false,
|
||||
'user' => 'test',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 25,
|
||||
'ssl' => false,
|
||||
'user' => 'test',
|
||||
'password' => '123456',
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testInvalidDatabaseName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
$db['database'] = 'invalid';
|
||||
|
||||
$mysql = new MysqlConnection($db);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
$db['db'] = 'invalid';
|
||||
$psql = new PostgresConnection($db);
|
||||
$psql = new PostgresConnection($db);
|
||||
self::assertEquals(DatabaseStatus::FAILURE, $psql->getStatus());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
$db['db'] = 'invalid';
|
||||
$ssql = new SqlServerConnection($db);
|
||||
$ssql = new SqlServerConnection($db);
|
||||
self::assertEquals(DatabaseStatus::FAILURE, $ssql->getStatus());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,49 +34,49 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$this->model = new BaseModel();
|
||||
$this->modelArray = [
|
||||
'id' => 0,
|
||||
'string' => 'Base',
|
||||
'int' => 11,
|
||||
'bool' => false,
|
||||
'null' => null,
|
||||
'float' => 1.3,
|
||||
'json' => [1, 2, 3],
|
||||
'id' => 0,
|
||||
'string' => 'Base',
|
||||
'int' => 11,
|
||||
'bool' => false,
|
||||
'null' => null,
|
||||
'float' => 1.3,
|
||||
'json' => [1, 2, 3],
|
||||
'jsonSerializable' => new class() implements \JsonSerializable {
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [1, 2, 3];
|
||||
}
|
||||
},
|
||||
'datetime' => new \DateTime('2005-10-11'),
|
||||
'datetime' => new \DateTime('2005-10-11'),
|
||||
'datetime_null' => null,
|
||||
'conditional' => '',
|
||||
'ownsOneSelf' => [
|
||||
'id' => 0,
|
||||
'conditional' => '',
|
||||
'ownsOneSelf' => [
|
||||
'id' => 0,
|
||||
'string' => 'OwnsOne',
|
||||
],
|
||||
'belongsToOne' => [
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'string' => 'BelongsTo',
|
||||
],
|
||||
'hasManyDirect' => [
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'string' => 'ManyToManyDirect',
|
||||
'to' => 0,
|
||||
'to' => 0,
|
||||
],
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'string' => 'ManyToManyDirect',
|
||||
'to' => 0,
|
||||
'to' => 0,
|
||||
],
|
||||
],
|
||||
'hasManyRelations' => [
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'string' => 'ManyToManyRel',
|
||||
],
|
||||
[
|
||||
'id' => 0,
|
||||
'id' => 0,
|
||||
'string' => 'ManyToManyRel',
|
||||
],
|
||||
],
|
||||
|
|
@ -276,22 +276,22 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
$id2 = BaseModelMapper::create($model2);
|
||||
$id3 = BaseModelMapper::create($model3);
|
||||
|
||||
$cond1 = new Conditional();
|
||||
$cond1 = new Conditional();
|
||||
$cond1->language = 'de';
|
||||
$cond1->title = 'cond1_de';
|
||||
$cond1->base = $id1;
|
||||
$cond1->title = 'cond1_de';
|
||||
$cond1->base = $id1;
|
||||
ConditionalMapper::create($cond1);
|
||||
|
||||
$cond2 = new Conditional();
|
||||
$cond2 = new Conditional();
|
||||
$cond2->language = 'en';
|
||||
$cond2->title = 'cond1_en';
|
||||
$cond2->base = $id1;
|
||||
$cond2->title = 'cond1_en';
|
||||
$cond2->base = $id1;
|
||||
ConditionalMapper::create($cond2);
|
||||
|
||||
$cond3 = new Conditional();
|
||||
$cond3 = new Conditional();
|
||||
$cond3->language = 'de';
|
||||
$cond3->title = 'cond2_de';
|
||||
$cond3->base = $id2;
|
||||
$cond3->title = 'cond2_de';
|
||||
$cond3->base = $id2;
|
||||
ConditionalMapper::create($cond3);
|
||||
|
||||
$found = BaseModelMapper::withConditional('language', 'de')::getAll();
|
||||
|
|
@ -347,12 +347,12 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
$id = BaseModelMapper::create($this->model);
|
||||
$modelR = BaseModelMapper::get($id);
|
||||
|
||||
$modelR->string = 'Update';
|
||||
$modelR->int = '321';
|
||||
$modelR->bool = true;
|
||||
$modelR->float = 3.15;
|
||||
$modelR->null = null;
|
||||
$modelR->datetime = new \DateTime('now');
|
||||
$modelR->string = 'Update';
|
||||
$modelR->int = '321';
|
||||
$modelR->bool = true;
|
||||
$modelR->float = 3.15;
|
||||
$modelR->null = null;
|
||||
$modelR->datetime = new \DateTime('now');
|
||||
$modelR->datetime_null = null;
|
||||
|
||||
$id2 = BaseModelMapper::update($modelR);
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ class BaseModelMapper extends DataMapperAbstract
|
|||
'self' => 'test_has_many_rel_relations_src',
|
||||
],
|
||||
'conditional' => [
|
||||
'mapper' => ConditionalMapper::class,
|
||||
'table' => 'test_conditional',
|
||||
'external' => 'test_conditional_base',
|
||||
'column' => 'title',
|
||||
'mapper' => ConditionalMapper::class,
|
||||
'table' => 'test_conditional',
|
||||
'external' => 'test_conditional_base',
|
||||
'column' => 'title',
|
||||
'conditional' => true,
|
||||
'self' => null,
|
||||
'self' => null,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase
|
|||
protected function setUp() : void
|
||||
{
|
||||
$this->app = new class() extends ApplicationAbstract {
|
||||
protected string $appName = 'Api';
|
||||
protected string $appName = 'Api';
|
||||
};
|
||||
$this->app->router = new WebRouter();
|
||||
$this->app->dispatcher = new Dispatcher($this->app);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class CityMapperTest extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'database' => \realpath(__DIR__ . '/../../../Localization/Defaults/localization.sqlite'),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class CountryMapperTest extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'database' => \realpath(__DIR__ . '/../../../Localization/Defaults/localization.sqlite'),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class CurrencyMapperTest extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'database' => \realpath(__DIR__ . '/../../../Localization/Defaults/localization.sqlite'),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class IbanMapperTest extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'database' => \realpath(__DIR__ . '/../../../Localization/Defaults/localization.sqlite'),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class LanguageMapperTest extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass() : void
|
||||
{
|
||||
$con = new SqliteConnection([
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'prefix' => '',
|
||||
'db' => 'sqlite',
|
||||
'database' => \realpath(__DIR__ . '/../../../Localization/Defaults/localization.sqlite'),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,9 +90,9 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
|
|||
$eig = new EigenvalueDecomposition($A);
|
||||
|
||||
self::assertEqualsWithDelta([
|
||||
[0, 2/\sqrt(6), 1/\sqrt(3)],
|
||||
[1/\sqrt(2), -1/\sqrt(6), 1/\sqrt(3)],
|
||||
[-1/\sqrt(2), -1/\sqrt(6), 1/\sqrt(3)],
|
||||
[0, 2 / \sqrt(6), 1 / \sqrt(3)],
|
||||
[1 / \sqrt(2), -1 / \sqrt(6), 1 / \sqrt(3)],
|
||||
[-1 / \sqrt(2), -1 / \sqrt(6), 1 / \sqrt(3)],
|
||||
], $eig->getV()->toArray(), 0.2);
|
||||
}
|
||||
|
||||
|
|
@ -155,9 +155,9 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
|
|||
$eig = new EigenvalueDecomposition($A);
|
||||
|
||||
self::assertEqualsWithDelta([
|
||||
[-\sqrt(2/3), \sqrt(2/7), -1/\sqrt(293)],
|
||||
[-1/\sqrt(6), -3/\sqrt(14), -6/\sqrt(293)],
|
||||
[1/\sqrt(6), -1/\sqrt(14), -16/\sqrt(293)],
|
||||
[-\sqrt(2 / 3), \sqrt(2 / 7), -1 / \sqrt(293)],
|
||||
[-1 / \sqrt(6), -3 / \sqrt(14), -6 / \sqrt(293)],
|
||||
[1 / \sqrt(6), -1 / \sqrt(14), -16 / \sqrt(293)],
|
||||
], $eig->getV()->toArray(), 0.2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testLRect() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(0.235322, Integration::intLeftRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
||||
self::assertEqualsWithDelta(0.235322, Integration::intLeftRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||
self::assertEqualsWithDelta(4.654000, Integration::intLeftRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(12499992.500730, Integration::intLeftRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(17999991.001392, Integration::intLeftRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||
|
|
@ -47,7 +47,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testRRect() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(0.245025, Integration::intRightRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
||||
self::assertEqualsWithDelta(0.245025, Integration::intRightRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||
self::assertEqualsWithDelta(4.555991, Integration::intRightRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(12499997.500729, Integration::intRightRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(17999997.001390, Integration::intRightRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||
|
|
@ -60,7 +60,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testMRect() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(0.240137, Integration::intMiddleRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
||||
self::assertEqualsWithDelta(0.240137, Integration::intMiddleRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||
self::assertEqualsWithDelta(4.603772, Integration::intMiddleRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(12499995.000729, Integration::intMiddleRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(17999994.001391, Integration::intMiddleRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||
|
|
@ -73,7 +73,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testTrapeze() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(0.250025, Integration::intTrapezium(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
||||
self::assertEqualsWithDelta(0.250025, Integration::intTrapezium(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||
self::assertEqualsWithDelta(4.605986, Integration::intTrapezium(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(12500000.0, Integration::intTrapezium(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||
//self::assertEqualsWithDelta(18000000.0, Integration::intTrapezium(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testMean() : void
|
||||
{
|
||||
self::assertEquals(1/3, ExponentialDistribution::getMean(3));
|
||||
self::assertEquals(1 / 3, ExponentialDistribution::getMean(3));
|
||||
}
|
||||
|
||||
public function testMode() : void
|
||||
|
|
@ -49,7 +49,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testMedian() : void
|
||||
{
|
||||
self::assertEquals(1/3 * \log(2), ExponentialDistribution::getMedian(3));
|
||||
self::assertEquals(1 / 3 * \log(2), ExponentialDistribution::getMedian(3));
|
||||
}
|
||||
|
||||
public function testMgf() : void
|
||||
|
|
@ -62,12 +62,12 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testVariance() : void
|
||||
{
|
||||
self::assertEquals(1/(3 ** 2), ExponentialDistribution::getVariance(3));
|
||||
self::assertEquals(1 / (3 ** 2), ExponentialDistribution::getVariance(3));
|
||||
}
|
||||
|
||||
public function testStandardDeviation() : void
|
||||
{
|
||||
self::assertEquals(\sqrt(1/(3 ** 2)), ExponentialDistribution::getStandardDeviation(3));
|
||||
self::assertEquals(\sqrt(1 / (3 ** 2)), ExponentialDistribution::getStandardDeviation(3));
|
||||
}
|
||||
|
||||
public function testExKurtosis() : void
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class GammaDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
public function testPDFIntegerK() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(\exp(-1), GammaDistribution::getPdfIntegerK(1, 1, 1), 0.001);
|
||||
self::assertEqualsWithDelta(3 * \exp(-3/4) / 16, GammaDistribution::getPdfIntegerK(3, 2, 4), 0.001);
|
||||
self::assertEqualsWithDelta(3 * \exp(-3 / 4) / 16, GammaDistribution::getPdfIntegerK(3, 2, 4), 0.001);
|
||||
}
|
||||
|
||||
public function testMeanK() : void
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testMean() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(\exp(13/2), LogNormalDistribution::getMean(2, 3), 0.001);
|
||||
self::assertEqualsWithDelta(\exp(13 / 2), LogNormalDistribution::getMean(2, 3), 0.001);
|
||||
}
|
||||
|
||||
public function testVariance() : void
|
||||
|
|
@ -38,7 +38,7 @@ class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testStandardDeviation() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(\exp(13/2) * \sqrt(\exp(9) - 1), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
||||
self::assertEqualsWithDelta(\exp(13 / 2) * \sqrt(\exp(9) - 1), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
||||
self::assertEqualsWithDelta(\sqrt((\exp(9) - 1) * \exp(13)), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ class TDistributionTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testVariance() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(5/3, TDistribution::getVariance(5), 0.001);
|
||||
self::assertEqualsWithDelta(5 / 3, TDistribution::getVariance(5), 0.001);
|
||||
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getVariance(2), 0.001);
|
||||
}
|
||||
|
||||
public function testStandardDeviation() : void
|
||||
{
|
||||
self::assertEqualsWithDelta(\sqrt(5/3), TDistribution::getStandardDeviation(5), 0.001);
|
||||
self::assertEqualsWithDelta(\sqrt(5 / 3), TDistribution::getStandardDeviation(5), 0.001);
|
||||
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getStandardDeviation(2), 0.001);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class ZTestTest extends \PHPUnit\Framework\TestCase
|
|||
// http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_HypothesisTesting-ChiSquare/BS704_HypothesisTesting-ChiSquare_print.html
|
||||
public function testHypothesisFalse() : void
|
||||
{
|
||||
$a = 0.95;
|
||||
$a = 0.95;
|
||||
$observed = 0.512;
|
||||
$expected = 0.75;
|
||||
$total = 125; // total count of observed sample size
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateTextInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'text',
|
||||
'type' => 'input',
|
||||
'subtype' => 'text',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'text',
|
||||
],
|
||||
|
|
@ -57,10 +57,10 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateTextInputWithValue() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'text',
|
||||
'type' => 'input',
|
||||
'subtype' => 'text',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'text',
|
||||
],
|
||||
|
|
@ -83,15 +83,15 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateDateTimeInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'datetime',
|
||||
'type' => 'input',
|
||||
'subtype' => 'datetime',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'datetime',
|
||||
],
|
||||
'default' => [
|
||||
"value" => "2019-02-03 01:23",
|
||||
"value" => "2019-02-03 01:23",
|
||||
"format" => "Y-m-d",
|
||||
],
|
||||
];
|
||||
|
|
@ -110,15 +110,15 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateCheckboxInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'checkbox',
|
||||
'type' => 'input',
|
||||
'subtype' => 'checkbox',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'checkbox',
|
||||
],
|
||||
'default' => [
|
||||
'value' => 'testValue',
|
||||
'value' => 'testValue',
|
||||
'checked' => true,
|
||||
'content' => 'testContent',
|
||||
],
|
||||
|
|
@ -138,15 +138,15 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateCheckboxWithLanguageInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'checkbox',
|
||||
'type' => 'input',
|
||||
'subtype' => 'checkbox',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'checkbox',
|
||||
],
|
||||
'default' => [
|
||||
'value' => 'testValue',
|
||||
'value' => 'testValue',
|
||||
'checked' => false,
|
||||
'content' => 'testContent',
|
||||
],
|
||||
|
|
@ -166,15 +166,15 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateRadioInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'radio',
|
||||
'type' => 'input',
|
||||
'subtype' => 'radio',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'radio',
|
||||
],
|
||||
'default' => [
|
||||
'value' => 'testValue',
|
||||
'value' => 'testValue',
|
||||
'checked' => true,
|
||||
'content' => 'testContent',
|
||||
],
|
||||
|
|
@ -194,15 +194,15 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateRadioWithLanguageInput() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'input',
|
||||
'subtype' => 'radio',
|
||||
'type' => 'input',
|
||||
'subtype' => 'radio',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
'type' => 'radio',
|
||||
],
|
||||
'default' => [
|
||||
'value' => 'testValue',
|
||||
'value' => 'testValue',
|
||||
'checked' => false,
|
||||
'content' => 'testContent',
|
||||
],
|
||||
|
|
@ -222,7 +222,7 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateLabel() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'label',
|
||||
'type' => 'label',
|
||||
'attributes' => [
|
||||
'for' => 'testId',
|
||||
],
|
||||
|
|
@ -245,7 +245,7 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateWithLanguageLabel() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'label',
|
||||
'type' => 'label',
|
||||
'attributes' => [
|
||||
'for' => 'testId',
|
||||
],
|
||||
|
|
@ -268,9 +268,9 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateTextarea() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'textarea',
|
||||
'type' => 'textarea',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
],
|
||||
'default' => [
|
||||
|
|
@ -292,9 +292,9 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateWithValueTextarea() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'textarea',
|
||||
'type' => 'textarea',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
],
|
||||
'default' => [
|
||||
|
|
@ -316,9 +316,9 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateSelect() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'select',
|
||||
'type' => 'select',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
],
|
||||
'options' => [
|
||||
|
|
@ -345,9 +345,9 @@ class FormElementGeneratorTest extends \PHPUnit\Framework\TestCase
|
|||
public function testGenerateWithLanguageSelect() : void
|
||||
{
|
||||
$element = [
|
||||
'type' => 'select',
|
||||
'type' => 'select',
|
||||
'attributes' => [
|
||||
'id' => 'testId',
|
||||
'id' => 'testId',
|
||||
'name' => 'testName',
|
||||
],
|
||||
'options' => [
|
||||
|
|
|
|||
|
|
@ -54,27 +54,27 @@ class DomTest extends \PHPUnit\Framework\TestCase
|
|||
$obj->setSelector('#sel');
|
||||
|
||||
self::assertEquals([
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'selector' => '#sel',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
], $obj->toArray());
|
||||
|
||||
self::assertEquals(\json_encode([
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'selector' => '#sel',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
]), $obj->serialize());
|
||||
|
||||
self::assertEquals([
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'type' => 'dom',
|
||||
'time' => 3,
|
||||
'selector' => '#sel',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
'action' => DomAction::SHOW,
|
||||
'content' => 'msg',
|
||||
], $obj->jsonSerialize());
|
||||
|
||||
$obj2 = new Dom();
|
||||
|
|
|
|||
|
|
@ -57,28 +57,28 @@ class NotifyTest extends \PHPUnit\Framework\TestCase
|
|||
$obj->setTitle('title');
|
||||
|
||||
self::assertEquals([
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'title' => 'title',
|
||||
'level' => NotifyType::ERROR,
|
||||
], $obj->toArray());
|
||||
|
||||
self::assertEquals(\json_encode([
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'title' => 'title',
|
||||
'level' => NotifyType::ERROR,
|
||||
]), $obj->serialize());
|
||||
|
||||
self::assertEquals([
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'type' => 'notify',
|
||||
'time' => 3,
|
||||
'stay' => 5,
|
||||
'msg' => 'msg',
|
||||
'title' => 'title',
|
||||
'level' => NotifyType::ERROR,
|
||||
], $obj->jsonSerialize());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
protected function setUp() : void
|
||||
{
|
||||
$this->module = new class() extends ModuleAbstract {
|
||||
$this->module = new class() extends ModuleAbstract {
|
||||
const MODULE_VERSION = '1.2.3';
|
||||
|
||||
const MODULE_NAME = 'Test';
|
||||
|
|
@ -49,7 +49,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$this->app = new class() extends ApplicationAbstract {};
|
||||
$this->app = new class() extends ApplicationAbstract {};
|
||||
$this->app->eventManager = new EventManager();
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function create() : void
|
||||
{
|
||||
$model = new BaseModel();
|
||||
$model = new BaseModel();
|
||||
$model->hasManyRelations = [];
|
||||
$this->createModel(1, $model, BaseModelMapper::class, '', '127.0.0.1');
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
$old = new BaseModel();
|
||||
BaseModelMapper::create($old);
|
||||
|
||||
$new = clone $old;
|
||||
$new = clone $old;
|
||||
$new->string = 'Updated';
|
||||
|
||||
$this->updateModel(1, $old, $new, BaseModelMapper::class, '', '127.0.0.1');
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class ModuleInfoTest extends \PHPUnit\Framework\TestCase
|
|||
$info = new ModuleInfo(__DIR__ . '/info-test.json');
|
||||
$info->load();
|
||||
|
||||
$testObj = new class() {
|
||||
$testObj = new class() {
|
||||
public $test = 1;
|
||||
|
||||
public function test() : void
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ModuleManagerTest extends \PHPUnit\Framework\TestCase
|
|||
protected function setUp() : void
|
||||
{
|
||||
$this->app = new class() extends ApplicationAbstract {
|
||||
protected string $appName = 'Api';
|
||||
protected string $appName = 'Api';
|
||||
};
|
||||
$this->app->appName = 'Api';
|
||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ use phpOMS\Account\PermissionType;
|
|||
return [
|
||||
'^.*backend_admin -settings=general.*$' => [
|
||||
0 => [
|
||||
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
|
||||
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SETTINGS,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SETTINGS,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ use phpOMS\Router\RouteVerb;
|
|||
return [
|
||||
'^.*/backend/admin/settings/general.*$' => [
|
||||
0 => [
|
||||
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SETTINGS,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SETTINGS,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class ClientTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
self::markTestIncomplete();
|
||||
return;
|
||||
$pipes = [];
|
||||
$pipes = [];
|
||||
$process = \proc_open('php ClientTestHelper.php', [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes, __DIR__);
|
||||
|
||||
\sleep(5);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class ServerTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testSetupTCPSocket() : void
|
||||
{
|
||||
$pipes = [];
|
||||
$pipes = [];
|
||||
$process = \proc_open('php ServerTestHelper.php', [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes, __DIR__);
|
||||
|
||||
$socket = new Server($this->app);
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@ class AddressTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$expected = [
|
||||
'recipient' => '',
|
||||
'fao' => '',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'fao' => '',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'address' => '',
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'long' => 0,
|
||||
],
|
||||
],
|
||||
|
|
@ -117,15 +117,15 @@ class AddressTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$expected = [
|
||||
'recipient' => 'recipient',
|
||||
'fao' => 'fao',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'fao' => 'fao',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'address' => '',
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'long' => 0,
|
||||
],
|
||||
],
|
||||
|
|
@ -147,15 +147,15 @@ class AddressTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$expected = [
|
||||
'recipient' => 'recipient',
|
||||
'fao' => 'fao',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'fao' => 'fao',
|
||||
'location' => [
|
||||
'postal' => '',
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'address' => '',
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'state' => '',
|
||||
'geo' => [
|
||||
'lat' => 0,
|
||||
'long' => 0,
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -163,12 +163,12 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
|
|||
public function testPriorityChange() : void
|
||||
{
|
||||
$queue = new PriorityQueue();
|
||||
$id1 = $queue->insert('a');
|
||||
$id1 = $queue->insert('a');
|
||||
$queue->setPriority($id1, 3);
|
||||
self::assertEquals(3, $queue->get($id1)['priority']);
|
||||
|
||||
$queue = new PriorityQueue(PriorityMode::HIGHEST);
|
||||
$id1 = $queue->insert('a');
|
||||
$id1 = $queue->insert('a');
|
||||
$queue->setPriority($id1, 3);
|
||||
self::assertEquals(3, $queue->get($id1)['priority']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class UriFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDuplicatedQueryElements() : void
|
||||
{
|
||||
$uri = 'http://www.test-uri.com/path/here?id=123&ab=c&id=456#fragi';
|
||||
$uri = 'http://www.test-uri.com/path/here?id=123&ab=c&id=456#fragi';
|
||||
$expected = 'http://www.test-uri.com/path/here?id=456&ab=c#fragi';
|
||||
|
||||
UriFactory::setupUriBuilder(new HttpUri($uri));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class CommitTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue($commit->addFile('/some/file/path'));
|
||||
self::assertTrue($commit->addFile('/some/file/path2'));
|
||||
self::assertEquals([
|
||||
'/some/file/path' => [],
|
||||
'/some/file/path' => [],
|
||||
'/some/file/path2' => [],
|
||||
], $commit->getFiles());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -84,7 +84,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -107,7 +107,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -119,7 +119,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -142,7 +142,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -154,7 +154,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -177,7 +177,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -189,7 +189,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -204,7 +204,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->update();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -216,7 +216,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -239,7 +239,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -251,7 +251,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -266,7 +266,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->update();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -278,7 +278,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -301,7 +301,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -313,7 +313,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -328,7 +328,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->update();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -340,7 +340,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -367,7 +367,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -379,7 +379,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -393,7 +393,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/select.ods');
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
|
||||
$mapper->select([$builder]);
|
||||
|
||||
|
|
@ -419,7 +419,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -431,7 +431,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -445,7 +445,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/select.xls');
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
|
||||
$mapper->select([$builder]);
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper->insert();
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_1.*')->from('insert_1')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -483,7 +483,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$data = $builder->select('insert_2.*')->from('insert_2')->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||
self::assertEquals(
|
||||
[
|
||||
['id' => '1', 'int' => '2', 'decimal' => '2.0', 'bool' => '1', 'varchar' => 'Line 1', 'datetime' => '43631'],
|
||||
|
|
@ -497,7 +497,7 @@ class SpreadsheetDatabaseMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$mapper = new SpreadsheetDatabaseMapper($this->sqlite, __DIR__ . '/select.xlsx');
|
||||
|
||||
$builder = new Builder($this->sqlite, true);
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
$data = $builder->select('int', 'decimal', 'bool', 'varchar', 'datetime')->from('insert_1');
|
||||
|
||||
$mapper->select([$builder]);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class TarGzTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(TarGz::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test.tar.gz'
|
||||
));
|
||||
|
|
@ -93,8 +93,8 @@ class TarGzTest extends \PHPUnit\Framework\TestCase
|
|||
TarGz::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.tar.gz'
|
||||
);
|
||||
|
|
@ -102,8 +102,8 @@ class TarGzTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertFalse(TarGz::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.tar.gz'
|
||||
));
|
||||
|
|
@ -131,8 +131,8 @@ class TarGzTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(TarGz::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test3.tar.gz'
|
||||
));
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class TarTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(Tar::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test.tar'
|
||||
));
|
||||
|
|
@ -93,8 +93,8 @@ class TarTest extends \PHPUnit\Framework\TestCase
|
|||
Tar::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.tar'
|
||||
);
|
||||
|
|
@ -102,8 +102,8 @@ class TarTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertFalse(Tar::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.tar'
|
||||
));
|
||||
|
|
@ -131,8 +131,8 @@ class TarTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(Tar::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test3.tar'
|
||||
));
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class ZipTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(Zip::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test.zip'
|
||||
));
|
||||
|
|
@ -93,8 +93,8 @@ class ZipTest extends \PHPUnit\Framework\TestCase
|
|||
Zip::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.zip'
|
||||
);
|
||||
|
|
@ -102,8 +102,8 @@ class ZipTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertFalse(Zip::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test2.zip'
|
||||
));
|
||||
|
|
@ -131,8 +131,8 @@ class ZipTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(Zip::pack(
|
||||
[
|
||||
__DIR__ . '/test a.txt' => 'test a.txt',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
__DIR__ . '/test b.md' => 'test b.md',
|
||||
__DIR__ . '/test' => 'test',
|
||||
],
|
||||
__DIR__ . '/test3.zip'
|
||||
));
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ class ArrayParserTest extends \PHPUnit\Framework\TestCase
|
|||
};
|
||||
|
||||
$array = [
|
||||
'string' => 'test',
|
||||
0 => 1,
|
||||
2 => true,
|
||||
'string' => 'test',
|
||||
0 => 1,
|
||||
2 => true,
|
||||
'string2' => 1.3,
|
||||
3 => null,
|
||||
4 => [
|
||||
3 => null,
|
||||
4 => [
|
||||
0 => 'a',
|
||||
1 => 'b',
|
||||
],
|
||||
|
|
@ -55,12 +55,12 @@ class ArrayParserTest extends \PHPUnit\Framework\TestCase
|
|||
];
|
||||
|
||||
$expected = [
|
||||
'string' => 'test',
|
||||
0 => 1,
|
||||
2 => true,
|
||||
'string' => 'test',
|
||||
0 => 1,
|
||||
2 => true,
|
||||
'string2' => 1.3,
|
||||
3 => null,
|
||||
4 => [
|
||||
3 => null,
|
||||
4 => [
|
||||
0 => 'a',
|
||||
1 => 'b',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
$view->addView('sub', $view2);
|
||||
self::assertEquals([
|
||||
0 => '<strong>Test</strong>',
|
||||
0 => '<strong>Test</strong>',
|
||||
'sub' => ['<strong>Test</strong>'],
|
||||
],
|
||||
$view->toArray()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user