EloquentTagRepositoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_finds_a_tag_by_name() 0 15 1
1
<?php namespace Modules\Blog\Tests;
2
3
use Illuminate\Support\Facades\App;
4
5
class EloquentTagRepositoryTest extends BaseBlogTestCase
6
{
7
    /** @test */
8
    public function it_finds_a_tag_by_name()
9
    {
10
        // Prepare
11
        $this->createTag();
12
        $this->createTag();
13
        $tag = $this->createTag();
14
15
        // Assert
16
        $foundTag = $this->tag->findByName($tag->name);
17
        $this->assertEquals($tag->translate('en')->name, $foundTag[0]['name']);
18
19
        App::setLocale('fr');
20
        $foundTag = $this->tag->findByName($tag->name);
21
        $this->assertEquals($tag->translate('fr')->name, $foundTag[0]['name']);
22
    }
23
}
24