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
Bug
introduced
by
![]() |
|||||
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
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. ![]() |
|||||
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 |