mirror of
https://github.com/kbwo/testing-language-server.git
synced 2025-07-24 11:23:42 +00:00
feat: implement phpunit adapter
This commit is contained in:
parent
daa8db434c
commit
3e3d4c5db1
15 changed files with 2125 additions and 9 deletions
30
demo/phpunit/src/CalculatorTest.php
Normal file
30
demo/phpunit/src/CalculatorTest.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use App\Calculator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CalculatorTest extends TestCase
|
||||
{
|
||||
public function testAdd()
|
||||
{
|
||||
$calculator = new Calculator();
|
||||
$result = $calculator->add(2, 3);
|
||||
$this->assertEquals(5, $result);
|
||||
}
|
||||
|
||||
public function testSubtract()
|
||||
{
|
||||
$calculator = new Calculator();
|
||||
$result = $calculator->subtract(5, 3);
|
||||
$this->assertEquals(2, $result);
|
||||
}
|
||||
|
||||
public function testFail1()
|
||||
{
|
||||
$calculator = new Calculator();
|
||||
$result = $calculator->subtract(10, 2);
|
||||
$this->assertEquals(1, $result);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue