Completed
Push — master ( b6e75f...2f94b1 )
by Baldur
02:03
created

LineItemTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDescriptionLength() 0 8 1
1
<?php
2
3
namespace LAShowroom\TaxJarBundle\Tests\Model\Transaction;
4
5
use LAShowroom\TaxJarBundle\Model\TaxCategory;
6
use LAShowroom\TaxJarBundle\Model\Transaction\LineItem;
7
8
class LineItemTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testDescriptionLength()
11
    {
12
        $lineItem = new LineItem('doge', 1, TaxCategory::BOOKS_GENERAL, 1.0);
13
        $lineItem->setDescription(str_repeat('x', 260));
14
15
        $this->assertEquals(255, strlen($lineItem->getDescription()));
16
        $this->assertStringEndsWith('...', $lineItem->getDescription());
17
    }
18
}
19