-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIntersectionOfTwoArraysTest.php
32 lines (26 loc) · 1.16 KB
/
IntersectionOfTwoArraysTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
namespace leetcode\tests;
use PHPUnit\Framework\TestCase;
use leetcode\IntersectionOfTwoArrays;
class IntersectionOfTwoArraysTest extends TestCase
{
public function testIntersection(): void
{
self::assertSame([], IntersectionOfTwoArrays::intersection([], [2, 2]));
self::assertSame([2], IntersectionOfTwoArrays::intersection([1, 2, 3, 1], [2, 2]));
self::assertSame([9, 4], IntersectionOfTwoArrays::intersection([4, 9, 5], [9, 4, 9, 8, 4]));
}
public function testIntersection2(): void
{
self::assertSame([], IntersectionOfTwoArrays::intersection2([], [2, 2]));
self::assertSame([2], IntersectionOfTwoArrays::intersection2([1, 2, 3, 1], [2, 2]));
self::assertSame([4, 9], IntersectionOfTwoArrays::intersection2([4, 9, 5], [9, 4, 9, 8, 4]));
}
public function testIntersection3(): void
{
self::assertSame([], IntersectionOfTwoArrays::intersection3([], [2, 2]));
self::assertSame([2], IntersectionOfTwoArrays::intersection3([1, 2, 3, 1], [2, 2]));
self::assertSame([9, 4], IntersectionOfTwoArrays::intersection3([4, 9, 5], [9, 4, 9, 8, 4]));
}
}