PHP Classes

File: tests/Unit/Helpers/CycleHelperTest.php

Recommend this page to a friend!
  Classes of DeGraciaMathieu   PHP Class Dependencies Analyzer   tests/Unit/Helpers/CycleHelperTest.php   Download  
File: tests/Unit/Helpers/CycleHelperTest.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: Yesterday
Size: 562 bytes
 

Contents

Class file image Download
<?php

use App\Presenter\Commands\Cyclic\Summary\CycleHelper;

test('it formats a cycle', function () {

   
$cycle = ['A', 'B', 'C'];

   
$formatted = CycleHelper::through($cycle);

   
expect($formatted)->toBe('A -> B -> C -> A');
});

test('it formats a cycle with readable names', function () {

   
$cycle = [
       
'App\Domain\Services\BarService',
       
'App\Domain\Services\FooService',
    ];

   
$formatted = CycleHelper::through($cycle);

   
expect($formatted)->toBe('\Services\BarService -> \Services\FooService -> \Services\BarService');
});