Skip to content

Commit

Permalink
✅ Naming tests suite name with namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoslayertech committed Aug 15, 2023
1 parent 66d98f8 commit 9ac7fbc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
6 changes: 5 additions & 1 deletion Bootgly/ABI/__Array/tests/@.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php

namespace Bootgly\ABI\__Array;


return [
// * Config
'autoBoot' => __DIR__,
Expand All @@ -7,7 +11,7 @@
'autoSummarize' => true,
'exitOnFailure' => true,
// * Data
'suiteName' => '__Array',
'suiteName' => __NAMESPACE__,
'tests' => [
'1.x-dynamic-list',
'1.x-dynamic-multidimensional',
Expand Down
2 changes: 1 addition & 1 deletion Bootgly/ABI/__String.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __get (string $index)
switch ($index) {
// * Meta
case 'length':
// TODO move check to autoload system and cache the results?
// TODO move functions check to autoload system and cache the results?
if ( function_exists('mb_strlen') ) {
return mb_strlen($this->string, $this->encoding);
} else if ( function_exists('iconv_strlen') ) {
Expand Down
5 changes: 4 additions & 1 deletion Bootgly/ABI/__String/Path/tests/@.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

namespace Bootgly\ABI\__String\Path;

return [
// * Config
'autoBoot' => __DIR__,
Expand All @@ -7,7 +10,7 @@
'autoSummarize' => true,
'exitOnFailure' => true,
// * Data
'suiteName' => 'Path',
'suiteName' => __NAMESPACE__,
'tests' => [
// construct
'1.1-construct_path',
Expand Down
30 changes: 15 additions & 15 deletions Bootgly/ABI/data/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function subtract (int $column) : int|float
$result = 0;
foreach ($data as $__row__ => $rows) {
foreach ($rows as $__column__ => $data) {
if ($column === $__column__) {
$result -= $data;
}
if ($column === $__column__) {
$result -= $data;
}
}
}

Expand All @@ -118,9 +118,9 @@ public function multiply (int $column) : int|float
$result = 1;
foreach ($data as $__row__ => $rows) {
foreach ($rows as $__column__ => $data) {
if ($column === $__column__) {
$result *= $data;
}
if ($column === $__column__) {
$result *= $data;
}
}
}

Expand All @@ -139,13 +139,13 @@ public function divide (int $column) : null|float
$result = null;
foreach ($data as $__row__ => $rows) {
foreach ($rows as $__column__ => $data) {
if ($column === $__column__) {
if ($result === null) {
$result = $data;
} else {
$result /= $data;
}
if ($column === $__column__) {
if ($result === null) {
$result = $data;
} else {
$result /= $data;
}
}
}
}

Expand All @@ -164,9 +164,9 @@ public function find (int $column, $value) : bool

foreach ($data as $__row__ => $rows) {
foreach ($rows as $__column__ => $data) {
if ($column === $__column__ && $value === $data) {
return true;
}
if ($column === $__column__ && $value === $data) {
return true;
}
}
}

Expand Down

0 comments on commit 9ac7fbc

Please sign in to comment.