Completed
Push — 2.0 ( 0357a9...3fe951 )
by Peter
08:22 queued 10s
created

LocateExecutorSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_should_not_found_string() 0 5 1
A it_should_not_found_string_with_offset() 0 4 1
A it_should_found_string() 0 4 1
A it_should_found_string_with_offset() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of the Happyr Doctrine Specification package.
6
 *
7
 * (c) Tobias Nyholm <[email protected]>
8
 *     Kacper Gunia <[email protected]>
9
 *     Peter Gribanov <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace tests\Happyr\DoctrineSpecification\Operand\PlatformFunction\Executor;
16
17
use Happyr\DoctrineSpecification\Operand\PlatformFunction\Executor\LocateExecutor;
18
use PhpSpec\ObjectBehavior;
19
20
/**
21
 * @mixin LocateExecutor
22
 */
23
final class LocateExecutorSpec extends ObjectBehavior
24
{
25
    public function it_should_not_found_string(): void
26
    {
27
        $this('foo', 'bar')->shouldBe(0);
28
        $this('foo', 'bar', 1)->shouldBe(0);
29
    }
30
31
    public function it_should_not_found_string_with_offset(): void
32
    {
33
        $this('foo', 'foobar', 3)->shouldBe(0);
34
    }
35
36
    public function it_should_found_string(): void
37
    {
38
        $this('foo', 'barfoobaz')->shouldBe(4);
39
    }
40
41
    public function it_should_found_string_with_offset(): void
42
    {
43
        $this('foo', 'barfoobaz', 3)->shouldBe(4);
44
    }
45
}
46