PHP Classes

File: tests/Unit/Services/InstabilityTest.php

Recommend this page to a friend!
  Classes of DeGraciaMathieu   PHP Class Dependencies Analyzer   tests/Unit/Services/InstabilityTest.php   Download  
File: tests/Unit/Services/InstabilityTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Class Dependencies Analyzer
Analyze the dependencies of project classes
Author: By
Last change:
Date: 1 month ago
Size: 460 bytes
 

Contents

Class file image Download
<?php

use App\Domain\Services\Instability;
use
App\Domain\ValueObjects\Coupling;

test('it calculates the instability', function (int $afferent, int $efferent, float $expected) {

   
$instability = Instability::calculate(
       
Coupling::from($afferent),
       
Coupling::from($efferent),
    );

   
expect($instability)->toBe($expected);

})->
with([
    [
1, 1, 0.5],
    [
1, 2, 0.3333333333333333],
    [
2, 1, 0.6666666666666666],
    [
0, 0, 0.0],
]);