From 953f614caa3adaffc673ad3d777a5cd6cb639b34 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 6 Mar 2025 12:31:26 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- php/tests/clTest.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 php/tests/clTest.php diff --git a/php/tests/clTest.php b/php/tests/clTest.php new file mode 100644 index 0000000..d2b834f --- /dev/null +++ b/php/tests/clTest.php @@ -0,0 +1,37 @@ + 42, "b" => "tesxt"]; $arrayKeys = array_keys($array); + $xarray = ["parasite0", "a" => 42, "parasite1", "b" => "tesxt"]; $xarrayKeys = array_keys($array); + $ref = ["a" => "int", "b" => "text"]; $refKeys = array_keys($ref); + $missingArray = ["c" => true]; $missingKeys = array_keys($missingArray); + $missingRef = ["c" => "bool"]; $missingKeys = array_keys($missingRef); + + $this->checkKeys(null, null, true, [], [], []); + $this->checkKeys(null, [], true, [], [], []); + $this->checkKeys([], null, true, [], [], []); + $this->checkKeys([], [], true, [], [], []); + + $this->checkKeys(null, $ref, false, [], [], $refKeys); + $this->checkKeys([], $ref, false, [], [], $refKeys); + + $this->checkKeys($array, null, true, [], $arrayKeys, []); + $this->checkKeys($array, [], true, [], $arrayKeys, []); + + $this->checkKeys($array, $ref, true, $arrayKeys, [], []); + $this->checkKeys(cl::merge($array, $missingArray), $ref, true, $arrayKeys, $missingKeys, []); + $this->checkKeys($array, cl::merge($ref, $missingRef), false, $arrayKeys, [], $missingKeys); + + $this->checkKeys($xarray, $ref, false, $arrayKeys, [0, 1], []); + } +}