ValueTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
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 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAddContentWhenQuotesHaveBeenClosedWillThrowAnException() 0 13 1
1
<?php
2
/**
3
 * This file is part of graze/csv-token
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/csv-token/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/csv-token
12
 */
13
14
namespace Graze\CsvToken\Test\Unit\ValueParser;
15
16
use Graze\CsvToken\Test\TestCase;
17
use Graze\CsvToken\ValueParser\Value;
18
use RuntimeException;
19
20
class ValueTest extends TestCase
21
{
22
    public function testAddContentWhenQuotesHaveBeenClosedWillThrowAnException()
23
    {
24
        $value = new Value();
25
26
        $value->setInQuotes(true);
27
        $value->addContent('some stuff');
28
        $value->setInQuotes(false);
29
30
        static::assertEquals('some stuff', $value->getValue());
31
32
        static::expectException(RuntimeException::class);
33
        $value->addContent('more content');
34
    }
35
}
36