Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | public function test_delete() |
||
21 | { |
||
22 | $query = null; |
||
23 | |||
24 | $adapter = Mockery::mock(MySQLi::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||
25 | $adapter->shouldReceive('cleanData')->andReturnArg(0); |
||
26 | |||
27 | /** @var Connection|Mockery\Mock $database */ |
||
28 | $database = Mockery::mock(Connection::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||
29 | $database->shouldReceive('execute')->with(\Mockery::capture($query))->once(); |
||
30 | $database->setAdapter($adapter); |
||
31 | |||
32 | $emailsTable = new Emails(); |
||
33 | $emailsTable->setDB($database); |
||
34 | ModelLocator::set('emails', $emailsTable); |
||
35 | |||
36 | $command = new EmailsCleanupRecords(); |
||
37 | $command->handle(); |
||
38 | |||
39 | self::assertInstanceOf(Delete::class, $query); |
||
40 | self::assertSame( |
||
41 | 'DELETE FROM `emails` WHERE `type` = \'donation\' AND `date_sent` <= DATE_SUB(CURRENT_DATE(), INTERVAL 365 DAY) LIMIT 500', |
||
42 | $query->getString() |
||
43 | ); |
||
46 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths