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

TagRepositoryTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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