EmailsSendTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 10
c 1
b 0
f 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStoppingOnTwoInvalidBatches() 0 15 1
1
<?php
2
3
namespace Nip\MailModule\Tests\Console\Commands;
4
5
use Mockery;
0 ignored issues
show
Bug introduced by
The type Mockery was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Nip\MailModule\Console\Commands\EmailsSend;
7
use Nip\MailModule\Tests\AbstractTest;
8
9
/**
10
 * Class EmailsSendTest
11
 * @package Nip\MailModule\Tests\Console\Commands
12
 */
13
class EmailsSendTest extends AbstractTest
14
{
15
    public function testStoppingOnTwoInvalidBatches()
16
    {
17
        $command = Mockery::mock(EmailsSend::class)
18
            ->shouldAllowMockingProtectedMethods()
19
            ->makePartial();
20
21
        $command->shouldReceive('sendEmails')
22
            ->andReturn(0, 4, false);
23
24
        $command->shouldReceive('getEmailsBatch')->with(10, 0)->andReturn([]);
25
        $command->shouldReceive('getEmailsBatch')->with(10, 10)->andReturn([]);
26
        $command->shouldReceive('getEmailsBatch')->with(10, 20)->andReturn([]);
27
28
//        $this->expectOutputString('as');
29
        self::assertSame(4, $command->handle());
30
    }
31
}
32