[ns-pannel-connector] Refactoring connector (#318) #39
tests.yaml
on: push
Matrix: PHP Tests
Matrix: PHP Tests With Code Coverage
Matrix: PHP Tests For Mutants
Annotations
14 warnings
PHP Tests (8.2, ubuntu-latest) / Code Tests (PHP 8.2)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
PHP Tests With Code Coverage (8.2, ubuntu-latest) / Code Coverage (PHP 8.2)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/upload-artifact@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L55
Escaped Mutant for Mutator "Throw_":
--- Original
+++ New
@@ @@
public static function parse(Uuid\UuidInterface $connector, string $topic, string $payload, bool $retained = false) : array
{
if (!V1Validator::validate($topic)) {
- throw new Exceptions\ParseMessage('Provided topic is not valid');
+ new Exceptions\ParseMessage('Provided topic is not valid');
}
if (V1Validator::validateDeviceAttribute($topic)) {
return array_merge(self::parseDeviceAttribute($connector, $topic, $payload), ['retained' => $retained]);
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L96
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
if (V1Validator::validateChannelPart($topic)) {
preg_match(V1Validator::CHANNEL_PARTIAL_REGEXP, $topic, $matches);
- [, $device] = $matches + [null, null];
+ [, $device] = $matches + [null];
assert(is_string($device));
if (V1Validator::validateChannelAttribute($topic)) {
return array_merge(self::parseChannelAttribute($connector, $device, $topic, $payload), ['retained' => $retained]);
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L131
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
private static function parseDeviceAttribute(Uuid\UuidInterface $connector, string $topic, string $payload) : array
{
preg_match(V1Validator::DEVICE_ATTRIBUTE_REGEXP, $topic, $matches);
- [, $device, $attribute] = $matches + [null, null, null];
+ [, $device, $attribute] = $matches + [null, null];
assert(is_string($device) && is_string($attribute));
return ['connector' => $connector, 'device' => $device, 'attribute' => $attribute, 'value' => $payload];
}
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L132
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
{
preg_match(V1Validator::DEVICE_ATTRIBUTE_REGEXP, $topic, $matches);
[, $device, $attribute] = $matches + [null, null, null];
- assert(is_string($device) && is_string($attribute));
+ assert(is_string($device) || is_string($attribute));
return ['connector' => $connector, 'device' => $device, 'attribute' => $attribute, 'value' => $payload];
}
/**
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L152
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
private static function parseDeviceHardwareInfo(Uuid\UuidInterface $connector, string $topic, string $payload) : array
{
preg_match(V1Validator::DEVICE_HW_INFO_REGEXP, $topic, $matches);
- [, $device, $hardware] = $matches + [null, null, null];
+ [, $device, $hardware] = $matches + [null, null];
assert(is_string($device) && is_string($hardware));
return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_HARDWARE->value, 'parameter' => $hardware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
}
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L153
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
{
preg_match(V1Validator::DEVICE_HW_INFO_REGEXP, $topic, $matches);
[, $device, $hardware] = $matches + [null, null, null];
- assert(is_string($device) && is_string($hardware));
+ assert(is_string($device) || is_string($hardware));
return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_HARDWARE->value, 'parameter' => $hardware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
}
/**
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L160
Escaped Mutant for Mutator "UnwrapStrToLower":
--- Original
+++ New
@@ @@
preg_match(V1Validator::DEVICE_HW_INFO_REGEXP, $topic, $matches);
[, $device, $hardware] = $matches + [null, null, null];
assert(is_string($device) && is_string($hardware));
- return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_HARDWARE->value, 'parameter' => $hardware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
+ return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_HARDWARE->value, 'parameter' => $hardware, 'value' => Helpers\Payload::cleanName($payload)];
}
/**
* @return array<string, Uuid\UuidInterface|string>
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L174
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
private static function parseDeviceFirmwareInfo(Uuid\UuidInterface $connector, string $topic, string $payload) : array
{
preg_match(V1Validator::DEVICE_FW_INFO_REGEXP, $topic, $matches);
- [, $device, $firmware] = $matches + [null, null, null];
+ [, $device, $firmware] = $matches + [null, null];
assert(is_string($device) && is_string($firmware));
return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_FIRMWARE->value, 'parameter' => $firmware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
}
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L175
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
{
preg_match(V1Validator::DEVICE_FW_INFO_REGEXP, $topic, $matches);
[, $device, $firmware] = $matches + [null, null, null];
- assert(is_string($device) && is_string($firmware));
+ assert(is_string($device) || is_string($firmware));
return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_FIRMWARE->value, 'parameter' => $firmware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
}
/**
|
PHP Tests For Mutants (8.2, ubuntu-latest) / Mutation Tests (PHP 8.2):
src/API/V1Parser.php#L182
Escaped Mutant for Mutator "UnwrapStrToLower":
--- Original
+++ New
@@ @@
preg_match(V1Validator::DEVICE_FW_INFO_REGEXP, $topic, $matches);
[, $device, $firmware] = $matches + [null, null, null];
assert(is_string($device) && is_string($firmware));
- return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_FIRMWARE->value, 'parameter' => $firmware, 'value' => Helpers\Payload::cleanName(strtolower($payload))];
+ return ['connector' => $connector, 'device' => $device, 'extension' => Types\ExtensionType::FASTYBIRD_FIRMWARE->value, 'parameter' => $firmware, 'value' => Helpers\Payload::cleanName($payload)];
}
/**
* @return array<string, Uuid\UuidInterface|string|array<int, array<string, string>>|null>
|
Deprecation notice: v1, v2, and v3 of the artifact actions
The following artifacts were uploaded using a version of actions/upload-artifact that is scheduled for deprecation: "Logs - Mutations".
Please update your workflow to use v4 of the artifact actions.
Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
Logs - Mutations
|
2.07 MB |
|