it_links_global_facade_to_repository()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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