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

it_gets_all_tags_for_a_namespace()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

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