Issues (114)

tests/Feature/Facade/CreateIncluderTest.php (3 issues)

1
<?php
2
3
namespace Maestriam\Samurai\Tests\Feature\Facade;
4
5
use Maestriam\Samurai\Exceptions\DirectiveExistsException;
6
use Maestriam\Samurai\Support\Samurai;
7
use Maestriam\Samurai\Tests\TestCase;
8
9
class CreateIncluderTest extends TestCase
10
{
11
    public function testCreateIncluder()
12
    {
13
        $theme = 'bands/rainbow';
14
        $name  = 'musics/lady-of-the-lake';
15
16
        $this->theme($theme)->findOrCreate();
17
18
        $includer = Samurai::theme($theme)->include($name)->create();
0 ignored issues
show
The method theme() does not exist on Maestriam\Samurai\Support\Samurai. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        $includer = Samurai::/** @scrutinizer ignore-call */ theme($theme)->include($name)->create();
Loading history...
19
20
        $this->assertValidIncluder($includer);
21
    }
22
23
    public function testExistingIncluder()
24
    {
25
        $theme = 'bands/rainbow';
26
        $name  = 'musics/lady-of-the-lake';
27
28
        $this->theme($theme)->findOrCreate();
29
30
        $this->expectException(DirectiveExistsException::class);
31
32
        $includer1 = Samurai::theme($theme)->include($name)->create();
0 ignored issues
show
The assignment to $includer1 is dead and can be removed.
Loading history...
33
        $includer2 = Samurai::theme($theme)->include($name)->create();
0 ignored issues
show
The assignment to $includer2 is dead and can be removed.
Loading history...
34
    }
35
}