Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev committed Dec 22, 2023
1 parent 531e562 commit eec8e1e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"license": "MIT",
"autoload": {
"psr-4": {
"Javadev\\LeetCodePhp\\": ""
"\\": "Algorithms/s0001_two_sum"
}
},
"autoload-dev": {
"psr-4": {
"\\": "tests"
}
},
"authors": [
Expand Down
21 changes: 21 additions & 0 deletions tests/SolutionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use PHPUnit\Framework\TestCase;

class SolutionTest extends TestCase {
public function testTwoSum() {
$this->assertEquals([0, 1], (new Solution())->twoSum([2, 7, 11, 15], 9));
}

public function testTwoSum2() {
$this->assertEquals([1, 2], (new Solution())->twoSum([3, 2, 4], 6));
}

public function testTwoSum3() {
$this->assertEquals([0, 1], (new Solution())->twoSum([3, 3], 6));
}

public function testTwoSum4() {
$this->assertEquals([-1, -1], (new Solution())->twoSum([3, 3], 7));
}
}

0 comments on commit eec8e1e

Please sign in to comment.