Issues (78)

Tests/ServiceProviderTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Ikechukwukalu\Requirepin\Tests;
4
5
use Ikechukwukalu\Requirepin\RequirePinServiceProvider;
6
use Ikechukwukalu\Requirepin\Middleware\RequirePin;
7
8
class ServiceProviderTest extends TestCase
9
{
10
    public function test_merges_config(): void
11
    {
12
        static::assertSame(
13
            $this->app->make('files')
14
                ->getRequire(RequirePinServiceProvider::CONFIG),
15
            $this->app->make('config')->get('require-pin')
16
        );
17
    }
18
19
    public function test_loads_translations(): void
20
    {
21
        static::assertArrayHasKey('requirepin',
22
            $this->app->make('translator')->getLoader()->namespaces());
0 ignored issues
show
The method getLoader() does not exist on Illuminate\Translation\Translator. Did you maybe mean getLoaders()? ( Ignorable by Annotation )

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

22
            $this->app->make('translator')->/** @scrutinizer ignore-call */ getLoader()->namespaces());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
    }
24
25
    public function test_publishes_middleware(): void
26
    {
27
        $middleware = $this->app->make('router')->getMiddleware();
28
29
        static::assertSame(RequirePin::class, $middleware['require.pin']);
30
        static::assertArrayHasKey('require.pin', $middleware);
31
    }
32
33
}
34