Completed
Push — master ( 51084e...d852c9 )
by Yaro
07:57
created

InlineTests   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
1
<?php
2
3
namespace Yaro\Jarboe\Tests\Fields\Traits;
4
5
use Yaro\Jarboe\Table\Fields\AbstractField;
6
7
trait InlineTests
8
{
9
    /**
10
     * @test
11
     */
12
    public function default_inline()
13
    {
14
        $field = $this->field();
15
16
        $this->assertFalse($field->isInline());
17
    }
18
19
    /**
20
     * @test
21
     */
22
    public function enable_inline()
23
    {
24
        $field = $this->field()->inline();
25
26
        $this->assertTrue($field->isInline());
27
    }
28
29
    /**
30
     * @test
31
     */
32
    public function enable_and_disable_inline()
33
    {
34
        $field = $this->field()->inline()->inline(false);
35
36
        $this->assertFalse($field->isInline());
37
    }
38
39
    /**
40
     * @test
41
     */
42
    public function enable_inline_with_options()
43
    {
44
        $options = ['options'];
45
        $field = $this->field()->inline(true, $options);
46
47
        $this->assertEquals($options, $field->getInlineOptions());
48
    }
49
50
    /**
51
     * @test
52
     */
53
    public function check_inline_url()
54
    {
55
        $field = $this->field();
56
        $field->setInlineUrl('url');
57
58
        $this->assertEquals('url', $field->getInlineUrl());
59
    }
60
61
    abstract protected function field(): AbstractField;
62
}
63