WordFormatterTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrapTest() 0 12 1
1
<?php
2
3
namespace WordWrapHelper\Tests;
4
5
use WordWrapHelper\WordFormatter;
6
7
class WordFormatterTest extends \PHPUnit_Framework_TestCase {
8
    
9
    /**
10
     * @test
11
     */
12
    public function wrapTest()
13
    {
14
        $wordFormatter = new WordFormatter();
15
        
16
        $content = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.";
17
        
18
        $actualResult = $wordFormatter->wrap($content, 30, '-<br/>');
19
        
20
        $expectedResult = "Lorem Ipsum is simply dummy-<br/>text of the printing and-<br/>typesetting industry. Lorem-<br/>Ipsum has been the industry's-<br/>standard dummy text ever since-<br/>the 1500s, when an unknown-<br/>printer took a galley of type-<br/>and scrambled it to make a-<br/>type specimen book.";
21
        
22
        $this->assertEquals($expectedResult, $actualResult);
23
    }
24
}
25