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

LineItemTest::testDescriptionLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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