Completed
Push — master ( 4a1a93...a1efc1 )
by Nicolas
02:59
created

TagRepositoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
B it_gets_all_tags_for_a_namespace() 0 26 1
1
<?php
2
3
namespace Modules\Tag\Tests\Integration;
4
5
use Modules\Tag\Repositories\TagRepository;
6
use Modules\Tag\Tests\BaseTestCase;
7
8
class TagRepositoryTest extends BaseTestCase
9
{
10
    /**
11
     * @var TagRepository
12
     */
13
    private $tag;
14
15
    public function setUp()
16
    {
17
        parent::setUp();
18
19
        $this->tag = app(TagRepository::class);
20
    }
21
22
    /** @test */
23
    public function it_gets_all_tags_for_a_namespace()
24
    {
25
        $this->tag->create([
26
            'namespace' => 'asgardcms/media',
27
            'en' => [
28
                'slug' => 'media-tag',
29
                'name' => 'media tag',
30
            ],
31
        ]);
32
        $this->tag->create([
33
            'namespace' => 'asgardcms/media',
34
            'en' => [
35
                'slug' => 'media-tag',
36
                'name' => 'media tag',
37
            ],
38
        ]);
39
        $this->tag->create([
40
            'namespace' => 'asgardcms/blog',
41
            'en' => [
42
                'slug' => 'media-tag',
43
                'name' => 'media tag',
44
            ],
45
        ]);
46
47
        $this->assertCount(1, $this->tag->allForNamespace('asgardcms/blog'));
48
    }
49
}
50