GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ValuesInArrayTest   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 2
cbo 1
dl 0
loc 60
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A it_returns_true_when_all_needles_are_present_in_haystack() 0 4 1
A it_returns_false_when_not_all_needles_are_present_in_haystack() 0 4 1
A it_returns_true_for_empty_arrays() 0 4 1
A it_returns_true_for_empty_needles() 0 4 1
A it_returns_false_for_searching_for_needles_in_an_empty_haystack() 0 4 1
A it_returns_true_when_needle_is_present_in_haystack() 0 5 1
A it_returns_false_when_needle_is_not_present_in_haystack() 0 5 1
1
<?php
2
3
namespace Spatie\Test;
4
5
use function spatie\values_in_array;
6
use PHPUnit\Framework\TestCase;
7
8
class ValuesInArrayTest extends TestCase
9
{
10
    /**
11
     * @test
12
     */
13
    public function it_returns_true_when_all_needles_are_present_in_haystack()
14
    {
15
        $this->assertTrue(values_in_array(['a', 'b'], ['a', 'b', 'c']));
16
    }
17
18
    /**
19
     * @test
20
     */
21
    public function it_returns_false_when_not_all_needles_are_present_in_haystack()
22
    {
23
        $this->assertFalse(values_in_array(['a', 'b', 'd'], ['a', 'b', 'c']));
24
    }
25
26
    /**
27
     * @test
28
     */
29
    public function it_returns_true_for_empty_arrays()
30
    {
31
        $this->assertTrue(values_in_array([], []));
32
    }
33
34
    /**
35
     * @test
36
     */
37
    public function it_returns_true_for_empty_needles()
38
    {
39
        $this->assertTrue(values_in_array([], ['a', 'b', 'c']));
40
    }
41
42
    /**
43
     * @test
44
     */
45
    public function it_returns_false_for_searching_for_needles_in_an_empty_haystack()
46
    {
47
        $this->assertFalse(values_in_array(['a', 'b', 'c'], []));
48
    }
49
50
    /**
51
     * @test
52
     */
53
    public function it_returns_true_when_needle_is_present_in_haystack()
54
    {
55
        $this->assertTrue(values_in_array('a', ['a', 'b', 'c']));
56
        $this->assertTrue(values_in_array(['a'], ['a', 'b', 'c']));
57
    }
58
59
    /**
60
     * @test
61
     */
62
    public function it_returns_false_when_needle_is_not_present_in_haystack()
63
    {
64
        $this->assertFalse(values_in_array('d', ['a', 'b', 'c']));
65
        $this->assertFalse(values_in_array(['d'], ['a', 'b', 'c']));
66
    }
67
}
68