Issues (276)

tests/bootstrap.php (2 issues)

1
<?php
2
3
use Mockery as m;
4
use Nip\Cache\Stores\Repository;
5
use Nip\Container\Container;
6
use Nip\Database\Connections\Connection;
7
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
8
9
require dirname(__DIR__) . '/vendor/autoload.php';
10
11
define('PROJECT_BASE_PATH', __DIR__ . '/..');
12
define('TEST_BASE_PATH', __DIR__);
13
define('TEST_FIXTURE_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'fixtures');
14
15
$connection = new Connection(false);
0 ignored issues
show
false of type false is incompatible with the type Closure|PDO expected by parameter $pdo of Nip\Database\Connections\Connection::__construct(). ( Ignorable by Annotation )

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

15
$connection = new Connection(/** @scrutinizer ignore-type */ false);
Loading history...
16
$adapter = m::namedMock('TestAdapter', \Nip\Database\Adapters\MySQLi::class)->makePartial()
17
    ->shouldReceive('query')->andReturn(true)
18
    ->shouldReceive('lastInsertID')->andReturn(99)
0 ignored issues
show
The method shouldReceive() does not exist on Mockery\Expectation. ( Ignorable by Annotation )

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

18
    ->/** @scrutinizer ignore-call */ shouldReceive('lastInsertID')->andReturn(99)

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...
19
    ->shouldReceive('cleanData')->andReturnUsing(
20
        function ($arg) {
21
            return $arg;
22
        }
23
    )
24
    ->getMock();
25
$connection->setAdapter($adapter);
26
27
Container::setInstance(new Container());
28
Container::getInstance()->set('db.connection', $connection);
29
30
Container::getInstance()->set('inflector', new \Nip\Inflector\Inflector());
31
32
$adapter = new FilesystemAdapter('', 600, TEST_FIXTURE_PATH . '/cache');
33
$store = new Repository($adapter);
34
$store->clear();
35
Container::getInstance()->set('cache.store', $store);
36