PHP Classes

File: tests/Unit/Formatters/NameFormatterTest.php

Recommend this page to a friend!
  Classes of DeGraciaMathieu   PHP Class Dependencies Analyzer   tests/Unit/Formatters/NameFormatterTest.php   Download  
File: tests/Unit/Formatters/NameFormatterTest.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: 507 bytes
 

Contents

Class file image Download
<?php

use App\Presenter\Commands\Shared\NameFormatter;

test('it formats class names', function () {
   
expect(NameFormatter::className('App\Domain\Services\CyclicDependency'))->toBe('CyclicDependency');
});

test('it formats human readable names', function () {
   
expect(NameFormatter::humanReadable('App\Domain\Services\CyclicDependency'))->toBe('\\Services\\CyclicDependency');
});

test('it keeps short names', function () {
   
expect(NameFormatter::humanReadable('App\Foo'))->toBe('App\Foo');
});