-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFindPivotIndexTest.php
32 lines (26 loc) · 988 Bytes
/
FindPivotIndexTest.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 leetcode\FindPivotIndex;
use PHPUnit\Framework\TestCase;
class FindPivotIndexTest extends TestCase
{
public function testPivotIndex(): void
{
self::assertSame(3, FindPivotIndex::pivotIndex([1, 7, 3, 6, 5, 6]));
self::assertSame(-1, FindPivotIndex::pivotIndex([1, 2, 3]));
self::assertSame(0, FindPivotIndex::pivotIndex([2, 1, -1]));
}
public function testPivotIndex2(): void
{
self::assertSame(3, FindPivotIndex::pivotIndex2([1, 7, 3, 6, 5, 6]));
self::assertSame(-1, FindPivotIndex::pivotIndex2([1, 2, 3]));
self::assertSame(0, FindPivotIndex::pivotIndex2([2, 1, -1]));
}
public function testPivotIndex3(): void
{
self::assertSame(3, FindPivotIndex::pivotIndex3([1, 7, 3, 6, 5, 6]));
self::assertSame(-1, FindPivotIndex::pivotIndex3([1, 2, 3]));
self::assertSame(0, FindPivotIndex::pivotIndex3([2, 1, -1]));
}
}