$iterable * @psalm-param T $value * * @dataProvider provideData */ public function testContainsKey(bool $expected, iterable $iterable, $value): void { self::assertSame($expected, Iter\contains($iterable, $value)); } public function provideData(): iterable { yield [false, [], 0]; yield [false, [], 1]; yield [false, [], null]; yield [false, [0], null]; yield [true, [null], null]; yield [false, [1, 2], 0]; yield [true, [1, 2], 1]; yield [true, [1, 2], 2]; yield [false, ['hello' => 'world'], 'hello']; yield [true, ['hello' => 'world'], 'world']; yield [false, ['hello' => 'world'], 'worlD']; yield [true, [null => null], null]; yield [false, new Collection\Vector([1, 2]), 0]; yield [true, new Collection\Vector([1, 2]), 1]; yield [true, new Collection\Vector([1, 2]), 2]; yield [false, (fn () => yield 'foo' => 'bar')(), 'foo']; yield [true, (fn () => yield 'foo' => 'bar')(), 'bar']; } }