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.

it_doesnt_treat_values_as_keys()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\Test;
4
5
use function spatie\array_keys_exist;
6
use PHPUnit\Framework\TestCase;
7
8
class ArrayKeysExistTest extends TestCase
9
{
10
    /**
11
     * @test
12
     */
13
    public function it_returns_true_when_all_array_keys_exist()
14
    {
15
        $this->assertTrue(array_keys_exist(['a', 'b'], ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
16
    }
17
    /**
18
     * @test
19
     */
20
    public function it_doesnt_treat_values_as_keys()
21
    {
22
        $this->assertFalse(array_keys_exist(['a', 'b'], ['a', 'b', 'c']));
23
    }
24
25
    /**
26
     * @test
27
     */
28
    public function it_returns_false_when_not_all_needles_are_present_in_haystack()
29
    {
30
        $this->assertFalse(array_keys_exist(['a', 'b', 'd'], ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
31
    }
32
33
    /**
34
     * @test
35
     */
36
    public function it_returns_true_for_empty_arrays()
37
    {
38
        $this->assertTrue(array_keys_exist([], []));
39
    }
40
41
    /**
42
     * @test
43
     */
44
    public function it_returns_true_for_empty_needles()
45
    {
46
        $this->assertTrue(array_keys_exist([], ['a', 'b', 'c']));
47
    }
48
49
    /**
50
     * @test
51
     */
52
    public function it_returns_false_for_searching_for_needles_in_an_empty_haystack()
53
    {
54
        $this->assertFalse(array_keys_exist(['a', 'b', 'c'], []));
55
    }
56
57
    /**
58
     * @test
59
     */
60
    public function it_returns_true_when_a_single_array_key_exists()
61
    {
62
        $this->assertTrue(array_keys_exist('a', ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
63
        $this->assertTrue(array_keys_exist(['a'], ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
64
    }
65
66
    /**
67
     * @test
68
     */
69
    public function it_returns_false_when_needle_is_not_present_in_haystack()
70
    {
71
        $this->assertFalse(array_keys_exist('d', ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
72
        $this->assertFalse(array_keys_exist(['d'], ['a' => 'foo', 'b' => 'bar', 'c' => 'baz']));
73
    }
74
}
75