testAddContentWhenQuotesHaveBeenClosedWillThrowAnException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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