BlockFacadeTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_links_global_facade_to_repository() 0 6 1
A it_works_as_repository() 0 16 1
1
<?php
2
3
namespace Modules\Block\Tests\Integration;
4
5
use Illuminate\Database\Eloquent\Collection;
6
7
class BlockFacadeTest extends BaseBlockTest
8
{
9
    /** @test */
10
    public function it_links_global_facade_to_repository()
11
    {
12
        $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]);
13
14
        $this->assertInstanceOf(Collection::class, \Block::all());
15
    }
16
17
    /** @test */
18
    public function it_works_as_repository()
19
    {
20
        $this->block->create([
21
            'name' => 'test-block',
22
            'en' => [
23
                'body' => 'lorem en',
24
                'online' => true,
25
            ],
26
            'fr' => [
27
                'body' => 'lorem fr',
28
                'online' => true,
29
            ],
30
        ]);
31
32
        $this->assertEquals('lorem en', \Block::get('test-block'));
33
    }
34
}
35