mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Fixed mutation score by provideing more tests
This commit is contained in:
@@ -18,4 +18,28 @@ class VisitLocationTest extends TestCase
|
||||
$this->assertSame('1000.7', $location->getLatitude());
|
||||
$this->assertSame('-2000.4', $location->getLongitude());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideArgs
|
||||
*/
|
||||
public function isEmptyReturnsTrueWhenAllValuesAreEmpty(array $args, bool $isEmpty): void
|
||||
{
|
||||
$payload = new Location(...$args);
|
||||
$location = new VisitLocation($payload);
|
||||
|
||||
$this->assertEquals($isEmpty, $location->isEmpty());
|
||||
}
|
||||
|
||||
public function provideArgs(): iterable
|
||||
{
|
||||
yield [['', '', '', '', 0.0, 0.0, ''], true];
|
||||
yield [['', '', '', '', 0.0, 0.0, 'dd'], false];
|
||||
yield [['', '', '', 'dd', 0.0, 0.0, ''], false];
|
||||
yield [['', '', 'dd', '', 0.0, 0.0, ''], false];
|
||||
yield [['', 'dd', '', '', 0.0, 0.0, ''], false];
|
||||
yield [['dd', '', '', '', 0.0, 0.0, ''], false];
|
||||
yield [['', '', '', '', 1.0, 0.0, ''], false];
|
||||
yield [['', '', '', '', 0.0, 1.0, ''], false];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user