Skip to content

Commit

Permalink
add test extra
Browse files Browse the repository at this point in the history
  • Loading branch information
Mips2648 committed Oct 27, 2024
1 parent a0650ff commit 1ad8e13
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/MipsEqLogicTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testgetRequiredPackageDetail_approx() {
}
};

$result = $trait->getRequiredPackageDetail('jeedomdaemon~=1.0.0', $details);
$result = $trait->getRequiredPackageDetail('jeedomdaemon ~=1.0.0', $details);
$this->assertTrue($result);
$this->assertEquals('jeedomdaemon', $details[1]);
$this->assertEquals('~=', $details[2]);
Expand All @@ -42,13 +42,27 @@ public function testgetRequiredPackageDetail_greaterthan() {
}
};

$result = $trait->getRequiredPackageDetail('jeedomdaemon>=1.0.0', $details);
$result = $trait->getRequiredPackageDetail('jeedomdaemon>= 1.0.0', $details);
$this->assertTrue($result);
$this->assertEquals('jeedomdaemon', $details[1]);
$this->assertEquals('>=', $details[2]);
$this->assertEquals('1.0.0', $details[3]);
}

public function testgetRequiredPackageDetail_extra() {
$trait = new class {
use MipsEqLogicTrait {
getRequiredPackageDetail as public; // make the method public
}
};

$result = $trait->getRequiredPackageDetail('pymodbus[serial] == 3.7.3', $details);
$this->assertTrue($result);
$this->assertEquals('pymodbus[serial]', $details[1]);
$this->assertEquals('==', $details[2]);
$this->assertEquals('3.7.3', $details[3]);
}

public function testgetRequiredPackageDetail_equal() {
$trait = new class {
use MipsEqLogicTrait {
Expand Down

0 comments on commit 1ad8e13

Please sign in to comment.